Have just got back to working on my COBOL project after a break (life got in the way) and noticed a new release! Fantastic!
The new version seems to be causing some grief to me with regards to linkage passing..
Error I am receiving in GnuCOBOL 3.2 is LINKAGE item <Linkage item name> not passed by caller
I reverted back to 3.1.2 and the app starts working again..it's part of a larger codebase so will need to do some digging to isolate the specific condition causing the issue.
This is not a new topic for me.. See https://sourceforge.net/p/gnucobol/discussion/help/thread/7ce4211af8/
The previous message I was getting was LINKAGE item 'LINKAGE2' (accessed by 'LINKAGE2-DATA') not passed by caller Seems like a similar issue, but the example that I created on GitHub to recreate my previous issue works fine with both versions so it must be something else.
Just want to see if there have been any changes in this area and if so, what should I be looking out for or focusing on.
Thanks
Anthony
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hm, so is the module which raises this message still a COBOL modules that was called by COBOL? If this is the case - do you explicit set the number of parameters and ensured that the parameter for LINKAGE2 is non-NULL?
If you checkout the NEWS file, then you'll see that there were a bunch of changes around the check for parameters, for example by default with --debug/ -fec=program the caller's length is now checked, too.... and I'm quite sure that this would not work the way the original C code was done...
If you know the data is compatible and passed where necessary you can also add -fno-ec=PROGRAM-ARG-MISTMATCH to the compile of the (C)-called program - or adjust the called program to specify in its called ENTRY/ PROCEDURE DIVISION to specify a C calling convention.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the response Simon. I was able to get the app running on the new version.
So in my app, its always C then COBOL then C then COBOL.. Never COBOL to COBOL.. The C programs allocates memory in a shared area and passes references to that memory area via linkage when calling the COBOL program.
I added the -fno-ec=PROGRAM-ARG-MISTMATCH (is that a typo?? MIS_T_MATCH) to the COBOL module compile and it now successfully running.
I am getting some warning in the COBOL build that I don't get without the flag above enabled.
Looks like MOVE statement to my linkage area causes the issue. Not sure if that is intentional or not, or if means there is some issue with my code.
Another thing I have observed - this is on MacOS with ld version 1022.1 (latest)
I get a warning when using cobc command.. ld: warning: -undefined suppress is deprecated
It seems that cobc adds the following param that is no longer supported by macos. -undefined suppress
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello team!
Have just got back to working on my COBOL project after a break (life got in the way) and noticed a new release! Fantastic!
The new version seems to be causing some grief to me with regards to linkage passing..
Error I am receiving in GnuCOBOL 3.2 is
LINKAGE item <Linkage item name> not passed by callerI reverted back to 3.1.2 and the app starts working again..it's part of a larger codebase so will need to do some digging to isolate the specific condition causing the issue.
This is not a new topic for me.. See https://sourceforge.net/p/gnucobol/discussion/help/thread/7ce4211af8/
The previous message I was getting was
LINKAGE item 'LINKAGE2' (accessed by 'LINKAGE2-DATA') not passed by callerSeems like a similar issue, but the example that I created on GitHub to recreate my previous issue works fine with both versions so it must be something else.Just want to see if there have been any changes in this area and if so, what should I be looking out for or focusing on.
Thanks
Anthony
Hm, so is the module which raises this message still a COBOL modules that was called by COBOL? If this is the case - do you explicit set the number of parameters and ensured that the parameter for
LINKAGE2is non-NULL?If you checkout the NEWS file, then you'll see that there were a bunch of changes around the check for parameters, for example by default with
--debug/-fec=programthe caller's length is now checked, too.... and I'm quite sure that this would not work the way the original C code was done...If you know the data is compatible and passed where necessary you can also add
-fno-ec=PROGRAM-ARG-MISTMATCHto the compile of the (C)-called program - or adjust the called program to specify in its calledENTRY/PROCEDURE DIVISIONto specify a C calling convention.Thanks for the response Simon. I was able to get the app running on the new version.
So in my app, its always C then COBOL then C then COBOL.. Never COBOL to COBOL.. The C programs allocates memory in a shared area and passes references to that memory area via linkage when calling the COBOL program.
I added the
-fno-ec=PROGRAM-ARG-MISTMATCH(is that a typo?? MIS_T_MATCH) to the COBOL module compile and it now successfully running.I am getting some warning in the COBOL build that I don't get without the flag above enabled.
Looks like MOVE statement to my linkage area causes the issue. Not sure if that is intentional or not, or if means there is some issue with my code.
c generated code
Cobol code
Thanks again!
Anthony
How is that variable defined in COBOL?
10 X074-APP-ACTION PIC XXX.
Another thing I have observed - this is on MacOS with ld version 1022.1 (latest)
I get a warning when using cobc command..
ld: warning: -undefined suppress is deprecatedIt seems that cobc adds the following param that is no longer supported by macos.
-undefined suppressPlease add -v to your command line to check what is passed, then post that.
Question: Is this a build from source or a Homebrew one?
Yes, this is homebrew, not compiled from source.
That's a build/packaging issue, you possibly want to report that at https://github.com/Homebrew/homebrew-core/issues ; in any case you may want to ask brew to build it on your machine:
brew install --build-from-source gnucobolthen check if there's any difference.