gnucobol-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Parameters changing to NULL


From: Michael Potter
Subject: Re: Parameters changing to NULL
Date: Tue, 17 Aug 2021 21:45:09 -0400

I found this:

int       cob_get_num_params ( void );

But I have not found a "set" version of it.

Is there a compile time option that will turn this off?



On Tue, Aug 17, 2021 at 9:03 PM Michael Potter <pottmi@gmail.com> wrote:
What is a keyword I can search on that I can find that in the doc?

On Tue, Aug 17, 2021 at 8:53 PM Ron Norman <rjn@inglenet.com> wrote:
Yes that is the issue. 

There is a C to COBOL API that let’s you specify how many parameters are being passed. 

Cheers,
Ron Norman

On Aug 17, 2021, at 20:29, Michael Potter <pottmi@gmail.com> wrote:



We think we know what is going on.

We have COBOL calling C calling COBOL.

COBOL calls C with 1 parameter.
C calls COBOL with 2 parameters.

There is code in the cobol runtime system that is checking the number of parameters it was called with and NULLING out any "Extra" parameters.
But the code assumes that the number of parameters passed from COBOL To C (1) is still in effect when C calls COBOL.

does this make sense?

What is the best way to code around this?


On Mon, Aug 16, 2021 at 5:39 AM Martin Ward <martin@gkc.org.uk> wrote:
On 16/08/2021 02:25, Michael Potter wrote:
> If nothing else...   Please tell me how I can see the generated C code
> so I can study what might be happening.

cobc -C *.cbl

-C translation only; convert COBOL to C

--
                        Martin

Dr Martin Ward | Email: martin@gkc.org.uk | http://www.gkc.org.uk
G.K.Chesterton site: http://www.gkc.org.uk/gkc | Erdos number: 4

reply via email to

[Prev in Thread] Current Thread [Next in Thread]