× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Yes, I believe that sounds like the problem I had back on V5R1.
On rechecking yet again, it looks like the return value was 65K fixed
not varying.
Strangely, the MCH exception only appeared to arise during the handling
of a previous unmonitored program exception (eg substring out of
bounds). The substring exception was the first instruction. Following
that were some 130 procedure calls where the prototype declared a 65k
return value. Since the program died on the first instruction, the
procedures never even got called but obviously had still consumed too
much storage.
I guess when the default handlers kicked in they needed more space than
was available.
After that the activation group seemed pretty screwed cause other
subsequently called unrelated programs continued to crash.

Peter

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Barbara Morris
Sent: Friday, 28 November 2008 2:48 p.m.
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: Calling C from RPG: what am I doing wrong?


Nathan Andelin wrote:
Barbara eventually explained that this was an unavoidable
consequence of the code the compiler generates to handle varying
length return values, from which I concluded that such procedures
were potentially a bad practice.

Is this only with "large" return values? What about procedures that
return say a 50 byte description [trimmed]?

desc = codeDesc(code);


The problem is proportional to the size of the return value. Calling a
procedure that returns 50 bytes should not be a problem unless you call
it a zillion times in the same procedure.

The problem isn't particularly related to varying-length return values.
There is some additional automatic storage required for a call to a
procedure returning a value (probably not integer or float return
values, though, unless they are arrays).

Varying-length return values are an issue because it seems like they
should only have to return the actual returned length, but actually they

have to return the prototype-defined length.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.