]>
git.ipfire.org Git - thirdparty/gcc.git/commit
cobol: Avoid conflict with OVERFLOW in system headers [PR119217]
parse.h causes the COBOL build to break on Solaris:
cobol/parse.h:356:5: error: expected identifier before numeric constant
356 | OVERFLOW = 305, /* OVERFLOW */
| ^~~~~~~~
The problem is that <math.h> has
#define OVERFLOW 3
To avoid the conflict, this patch renames OVERFLOW to OVERFLOW_kw,
following existing praxis.
Btw., token_names.h has a comment claiming
// generated by ./token_names.h.gen ../../build/gcc/cobol/parse.h
but there's no token_names.h.gen anywhere in the tree, so I've updated
the file manually.
Bootstrapped without regressions on amd64-pc-solaris2.11,
sparcv9-sun-solaris2.11, and x86_64-pc-linux-gnu.
2025-04-08 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
gcc/cobol:
PR cobol/119217
* parse.y: Rename OVERFLOW to OVERFLOW_kw.
Specify type name in %token directive.
* scan.l: Likewise.
* token_names.h: Regenerate.
Co-Authored-By: Simon Sobisch <simonsobisch@gnu.org>