]> git.ipfire.org Git - thirdparty/gcc.git/commit
cobol: Avoid conflict with OVERFLOW in system headers [PR119217]
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Sun, 13 Apr 2025 20:48:44 +0000 (22:48 +0200)
committerRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Sun, 13 Apr 2025 20:48:44 +0000 (22:48 +0200)
commitb0fb746bf2ff533eccf3a4ea7fbbc02a9a1f8b81
tree97842f2ba315037450857363e736963782ffa914
parentee6173800ed1f9b653a85019ad2fa8e6d883823a
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>
gcc/cobol/parse.y
gcc/cobol/scan.l
gcc/cobol/token_names.h