I am very good at COBOL languages (really ~55 years). I know little of assembly/gcc. I can cobc process a large program and after language corrections get no errors or warnings in phase 1. Then I get errors and warnings I don't know how to fix. Please advise.
I use PCLINUXOS. My gcc and other packages are up-to-date. I installed packages: gnucobol, lib64gnucobol-devel, and lib64gnucobol4. I see /usr/local/share/gnucobol/config and .../cpy.
I ran:
The result is a "clean" COBOL listing but it is followed by errors that seem not to reference the COBOL source lines. Then cobc aborts. It may be that I need to do some manual gnu COBOL install steps to reference libraries or other configuration. I did none.
The errors seem to be repetitive. For brevity I have listed examples below. I suspect it's a single basic problem.
In file included from /usr/local/include/libcob.h:29,
from BCHECKS2.c:14:
BCHECKS2.c.h: In function 'cob_cmpswp_s16':
BCHECKS2.c.h:291:37: error: expected ')' before '__unaligned'
291 | val = COB_BSWAP_16 (*(short __unaligned *)p);
| ~ ^~~~~~~~~~~
BCHECKS2.c.h:291:30: warning: cast from pointer to integer of
different size [-Wpointer-to-int-cast]
291 | val = COB_BSWAP_16 (*(short __unaligned *)p);
| ^
BCHECKS2.c.h:291:29: error: invalid type argument of unary '*'
(have 'int')
291 | val = COB_BSWAP_16 (*(short __unaligned *)p);
| ^~~~~~~~~~~~~~~~~~~~~~~
In file included from BCHECKS2.c:24:
BCHECKS2.c.h: At top level:
BCHECKS2.c.h:296:9: error: unknown type name 'cob_decimal'
296 | static cob_decimal kc_1;
| ^~~~~~~~~~~
BCHECKS2.c.h:297:9: error: unknown type name 'cob_decimal'
297 | static cob_decimal *dc_1 = NULL;
| ^~~~~~~~~~~
BCHECKS2.c:1284:5: warning: implicit declaration of function
'cob_decimal_set_llint'; did you mean 'cob_decimal_alloc'?
[-Wimplicit-function-declaration]
1284 | cob_decimal_set_llint (d0, 0);
| ^~~~~~~~~~~~~~~~~~~~~
| cob_decimal_pop
BCHECKS2.c:1287:5: warning: implicit declaration of function
'cob_decimal_get_field' [-Wimplicit-function-declaration]
1287 | cob_decimal_get_field (d0, &f_41, 0);
| ^~~~~~~~~~~~~~~~~~~~~
BCHECKS2.c:1588:5: warning: implicit declaration of function
'cob_decimal_add'; did you mean 'cob_decimal_pop'?
[-Wimplicit-function-declaration]
1588 | cob_decimal_add (d0, d1);
| ^~~~~~~~~~~~~~~
--
Sent from my old Linux PC - no advertisement or legal disclaimer.
Last edit: Simon Sobisch 2023-01-19
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Anonymous and welcome to GnuCOBOL!
(You may still want to register/login, as this would remove the manual moderation of your posts, which is otherwise needed. You can still stay quite anonymous by using a "temp mail provider", if that's what you want.)
The error you see shows that something is broken in your setup. Foremost you've written that you installed system packages for GnuCOBOL, but also that you have GnuCOBOL file under "/usr/local", which is normally reserved for manual installations; I don't know a system that places system packages there.
Maybe you have done both a manual installation and a system one (that also works but need some additional setup)?
Concerning system packages: You may consider to remove those, then install gnucobol3 package, if this doesn't exist gnucobol (all dependencies should be installed automatically). After doing that a which cobc should most commonly result in /usr/bin/cobc.
As an alternative (or additional, once this is working) you may install GnuCOBOL 3.2-rc1 from a source tarball (a bit more complicated, but up-to-date). Just drop a note about the state and we'll figure out what works best for you.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am very good at COBOL languages (really ~55 years). I know little of assembly/gcc. I can cobc process a large program and after language corrections get no errors or warnings in phase 1. Then I get errors and warnings I don't know how to fix. Please advise.
I use PCLINUXOS. My gcc and other packages are up-to-date. I installed packages: gnucobol, lib64gnucobol-devel, and lib64gnucobol4. I see /usr/local/share/gnucobol/config and .../cpy.
I ran:
The result is a "clean" COBOL listing but it is followed by errors that seem not to reference the COBOL source lines. Then cobc aborts. It may be that I need to do some manual gnu COBOL install steps to reference libraries or other configuration. I did none.
The errors seem to be repetitive. For brevity I have listed examples below. I suspect it's a single basic problem.
--
Sent from my old Linux PC - no advertisement or legal disclaimer.
Last edit: Simon Sobisch 2023-01-19
Hi Anonymous and welcome to GnuCOBOL!
(You may still want to register/login, as this would remove the manual moderation of your posts, which is otherwise needed. You can still stay quite anonymous by using a "temp mail provider", if that's what you want.)
The error you see shows that something is broken in your setup. Foremost you've written that you installed system packages for GnuCOBOL, but also that you have GnuCOBOL file under "/usr/local", which is normally reserved for manual installations; I don't know a system that places system packages there.
Maybe you have done both a manual installation and a system one (that also works but need some additional setup)?
Concerning system packages: You may consider to remove those, then install
gnucobol3package, if this doesn't existgnucobol(all dependencies should be installed automatically). After doing that awhich cobcshould most commonly result in/usr/bin/cobc.As an alternative (or additional, once this is working) you may install GnuCOBOL 3.2-rc1 from a source tarball (a bit more complicated, but up-to-date). Just drop a note about the state and we'll figure out what works best for you.