Re: Parameters changing to NULL

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

 



Read the attached....
Although this is mainly for the 'trunk' version of GnuCOBOL. Some of it may have been merged into 3.x versions.

On Tue, Aug 17, 2021 at 9:45 PM Michael Potter <pottmi@xxxxxxxxx> wrote:
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@xxxxxxxxx> 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@xxxxxxxxxxxx> 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@xxxxxxxxx> 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@xxxxxxxxxx> 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@xxxxxxxxxx | http://www.gkc.org.uk
G.K.Chesterton site: http://www.gkc.org.uk/gkc | Erdos number: 4


--
Cheers
Ron Norman

Attachment: GnuCOBOL C Interaction.pdf
Description: Adobe PDF document


[Index of Archives]     [Gcc Help]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Info]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux