Re: Parameters changing to NULL

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

 




I have searched google.

I have searched duckduckgo

I have searched the source for 3.1.2

I have not found a reference to cob_call_cobol.


pottmi@macbook-pro-2 gnucobol-3.1.2 % grep -r cob_call_cobol *
pottmi@macbook-pro-2 gnucobol-3.1.2 % grep -r cob_call_entry *
pottmi@macbook-pro-2 gnucobol-3.1.2 %




On Wed, Aug 18, 2021 at 7:42 AM Ron Norman <rjn@xxxxxxxxxxxx> wrote:
cob_call_cobol  and/or cob_call_entry

On Wed, Aug 18, 2021 at 12:13 AM Michael Potter <pottmi@xxxxxxxxx> wrote:
We will build a sample when we get a chance.  Our code is pretty complex (it emulates CICS) so it takes a while to simplify it; won't be hard I just want to do a good job on it.  

I don't see any function call to set the number of called parameters in the PDF you provided; do you see it?

After reflecting on it I think I would prefer an option to disable this logic that mucks with the parameters.  Is the "mucking with the parameters" feature recently added?  It seems to me that I would have seen this in the last 13 years I have been using Open/GnuCOBOL.

On Tue, Aug 17, 2021 at 9:50 PM Ron Norman <rjn@xxxxxxxxxxxx> wrote:
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


--
Cheers
Ron Norman

[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