Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test with GnuCOBOL 1.1 / open source COBOL #81

Open
GitMensch opened this issue Jul 24, 2020 · 12 comments
Open

test with GnuCOBOL 1.1 / open source COBOL #81

GitMensch opened this issue Jul 24, 2020 · 12 comments

Comments

@GitMensch
Copy link
Contributor

That's primarily a reminder and a place to gather information about the compatibility.

Did anybody tried this with GC 1.1 (should be nearly identical to the code generation of OpenCOBOL 1.1; both are still used in some repos) ans/or Open Source Cobol?

So far we do know that it works completely with GC 3.1-rc1 and well with GC 2.2+ (only issue: setting works only for USAGE DISPLAY and "real" integers) - at least that's my point of knowledge.

@OlegKunitsyn
Copy link
Owner

I was trying to compile GC 1.1 on Alpine unsuccessfully. Is there any "official" GC Docker images?

@GitMensch
Copy link
Contributor Author

No, we may have a look at this later. What issues did you see on Alpine?

@OlegKunitsyn
Copy link
Owner

@GitMensch
Copy link
Contributor Author

That looks like a successful build (ok, some test failures but nothing severe). To prevent it to fail the make
make check || echo "not all tests passed, consider using a current version instead.

In any case I suggest to rename that branch to "OC1.1" and create a new "1.1" with GnuCOBOL 1.1.

@GitMensch
Copy link
Contributor Author

Any update on this yet?

@OlegKunitsyn
Copy link
Owner

Yes, https://hub.docker.com/r/olegkunitsyn/opencobol
Unknown option -job. How to pass arguments to OC 1.1. properly?

@GitMensch
Copy link
Contributor Author

Unknown option -job.

That's expected as this option

-j [], -job[=] run program after build, passing

is available since GnuCOBOL 2.2rc, not in an earlier version (including OpenCOBOL 2 dev/beta)

How to pass arguments to OC 1.1. properly?

--job just runs the binary after creation (either via cobcrun if it was compiled as a module or as executable itself), it is mostly used for quick tests and for COBOL "scripting" (using cobc -j in the interpreter line, then executing it).

It should not be considered a general purpose function and is not available in OpenCOBOL, open-source cobol, GnuCOBOL 1.1 or C*IT, so for gnucobol-debug I'd recommend against using it. Instead: check the return status of cobc for zero and depending on the execute either cobcrun prog args or prog args. That also reminds me on my personal biggest issue with this extension: #63.

@GitMensch
Copy link
Contributor Author

As there is a docker container for GnuCOBOL 1.1 now - is there any test result for this already? Any "known issues" (things that possibly need adjustments and/or stuff that can be documented as "regresseion when using with GnuCOBOL 1.1, consider updating)?

@OlegKunitsyn
Copy link
Owner

Yes, cobc: unrecognized option: Q. Seems OC 1.1 is unable to produce a coverage report.

@GitMensch
Copy link
Contributor Author

GitMensch commented Oct 31, 2020

The only way to do what -A/-Q is doing, is to query cobc --info for COB_LDFLAGS (often empty) and COB_CFLAGS and add the own parameters to this:

C:\TEMP>cobc D:\dev\GC11\extras\CBL_OC_DUMP.cob -v
preprocessing D:\dev\GC11\extras\CBL_OC_DUMP.cob into C:\TEMP\cob9434.cob
parsing C:\TEMP\cob9434.cob (D:\dev\GC11\extras\CBL_OC_DUMP.cob)
Return status:  0
translating C:\TEMP\cob9434.cob into C:\TEMP\cob9435.c (D:\dev\GC11\extras\CBL_OC_DUMP.cob)
gcc -pipe -I"D:\dev\GC11\include"  -Wno-unused -fsigned-char -Wno-pointer-sign  -shared -L"D:\dev\GC11\lib"  -DDLL_EXPORT -DPIC -Wl,--export-all-symbols -Wl,--enable-auto-import -o D:\dev\GC11\extras\CBL_OC_DUMP.dll C:\TEMP\cob9435.c -L/mingw/lib -lcob -lm -lgmp -lpdcurses -ldb-6.1

C:\TEMP>set "COB_LDFLAGS=-L"D:\dev\GC11\lib" --coverage"

C:\TEMP>cobc D:\dev\GC11\extras\CBL_OC_DUMP.cob -v
preprocessing D:\dev\GC11\extras\CBL_OC_DUMP.cob into C:\TEMP\cob4143.cob
parsing C:\TEMP\cob4143.cob (D:\dev\GC11\extras\CBL_OC_DUMP.cob)
Return status:  0
translating C:\TEMP\cob4143.cob into C:\TEMP\cob4144.c (D:\dev\GC11\extras\CBL_OC_DUMP.cob)
gcc -pipe -I"D:\dev\GC11\include"  -Wno-unused -fsigned-char -Wno-pointer-sign  -shared -L"D:\dev\GC11\lib" --coverage -DDLL_EXPORT -DPIC -Wl,--export-all-symbols -Wl,--enable-auto-import -o D:\dev\GC11\extras\CBL_OC_DUMP.dll C:\TEMP\cob4144.c -L/mingw/lib -lcob -lm -lgmp -lpdcurses -ldb-6.1

@OlegKunitsyn
Copy link
Owner

Thank you for detailed clarification. I don't think I'll implements this deep backward compatibility, but will keep the tickets open for upvoting.

@GitMensch
Copy link
Contributor Author

So if I got this right: everything works but the coverage? Then README could say this and we can change the issue to track the "coverage only manual" part here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants