Why on the same code file the compilation is done on 4.0 but compilation is stop on previous versions?
I have the same output on version 3.0-rc , 3.1.2, 3.2-dev.0 but it's only on the version 4.0-early-dev.0, why i have a different result?
**Version 3.0-rc**
[matigoal]$bashcompil-MDGFK10.shCOMPILATIONDE>./MDGFK10.cobInfileincludedfrom/tmp/cob14930_0.c:24:/tmp/cob14930_0.c.h:172:44:error:undeclared“a_22”here(outoffunction);didyouwanttouse“a_21”?staticcob_fieldf_392={1,b_350+634,&a_22};/* INDEX */^~~~a_21
**Version3.1.2**[matigoal]$bashcompil-MDGFK10.shCOMPILATIONOF>./MDGFK10.cobInfileincludedfrom/tmp/cob18713_0.c:21:/tmp/cob18713_0.c.h:172:44:error:undeclared“a_22”here(outoffunction);didyouwanttouse“a_21”?staticcob_fieldf_394={1,b_352+634,&a_22};/* INDEX */^~~~a_21
**Version3.2-dev.0**[matigoal]$bashcompil-MDGFK10.shCOMPILATIONOF>./MDGFK10.cobInfileincludedfrom/tmp/cob14950_0.c:21:/tmp/cob14950_0.c.h:172:44:error:undeclared“a_22”here(outoffunction);didyouwanttouse“a_21”?staticcob_fieldf_394={1,b_352+634,&a_22};/* INDEX */^~~~a_21`**Version4.0-early-dev.0**`
[ matigoal]$ bash compil-MDGFK10.sh
COMPILATION DE > ./MDGFK10.cob
Thanks for your help.
Last edit: M_D 2021-09-14
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
That's an error from the used "C" compiler - if you don't do special C-inclusions and/or special linking this is normally always a "codegen bug" of cobc, which seems to be "finally fixed" in 4.x.
But I don't know and neither can fix it for 3.x or merge a fix from 4.x, because I have no clue where this happens and why. Posting a COBOL source "reproducer" (just kick as much code out as you can keeping it compile with 4.x and not compile with 3.x) would allow people reading along to actually check what the bug is and how to solve it.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello Simon,
Just to know if you have a better idea what's going on,
that interest me to understant why this code didn't compile on 3.1.2 and 3.2.
Is that a syntax problème as saying IBM cob2 or is that a problème in cobc ?
Thank you !
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The C codegen part is definitely a problem in cobc - and after finishing the tests for the current parser adjustments and checking those in it is the next issue I'll look at.
It additional is potentially a syntax issue, in this case cobc will output a warning (or, if it is really bad, output a clear error message).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi everyone,
I am work on Centos 8.
Why on the same code file the compilation is done on 4.0 but compilation is stop on previous versions?
I have the same output on version 3.0-rc , 3.1.2, 3.2-dev.0 but it's only on the version 4.0-early-dev.0, why i have a different result?
Thanks for your help.
Last edit: M_D 2021-09-14
Looks like a bug which is fixed in 4.0.
If you can send a minimal reproducer we likely can merge the fix over to 3.x...
@sf-mensch
thank for your reply.
It's a undeclared variable but if it's undeclared on version 3.x normally she's always undeclared in version 4.0?
Last edit: M_D 2021-09-14
That's an error from the used "C" compiler - if you don't do special C-inclusions and/or special linking this is normally always a "codegen bug" of cobc, which seems to be "finally fixed" in 4.x.
But I don't know and neither can fix it for 3.x or merge a fix from 4.x, because I have no clue where this happens and why. Posting a COBOL source "reproducer" (just kick as much code out as you can keeping it compile with 4.x and not compile with 3.x) would allow people reading along to actually check what the bug is and how to solve it.
Hi Simon,
@sf-mensch
Sorry for the wait here the reproduction of the bug as requested in attachment.
Thank for your help.
Last edit: M_D 2021-10-05
@sf-mensch
I tested my script with the versions
3.0RC : it compiles
3.1.2 : I have an infinite loop
3.2 : I have an infinite loop
4.0 nightly : it compiles
I don't understand why some versions work and not the others
Thank for your help.
Last edit: M_D 2021-10-05
Because 4.x was split from 3 (where it worked) before 3.1 (where a change was made that will be included in 4.x later).
That's ok, I'll check that and likely fix the issue in until tomorrow for 3.2.
Hi Simon,
@sf-mensch
thank you so much for your help
Hello Simon,
Just to know if you have a better idea what's going on,
that interest me to understant why this code didn't compile on 3.1.2 and 3.2.
Is that a syntax problème as saying IBM cob2 or is that a problème in cobc ?
Thank you !
The C codegen part is definitely a problem in cobc - and after finishing the tests for the current parser adjustments and checking those in it is the next issue I'll look at.
It additional is potentially a syntax issue, in this case cobc will output a warning (or, if it is really bad, output a clear error message).
Ok thank you,
waiting for the feed back