https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120730
Bug ID: 120730
Summary: parse.cc doesn't compile with bison 3.5.1
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: cobol
Assignee: unassigned at gcc dot gnu.org
Reporter: ro at gcc dot gnu.org
CC: jklowden at gcc dot gnu.org, rdubner at gcc dot gnu.org
Target Milestone: ---
When trying to build COBOL on Ubuntu 20.04 with the bundled bison 3.5.1,
compilation fails:
/vol/gcc/src/hg/master/local/gcc/cobol/parse.y: In function ‘const char*
keyword_str(int)’:
/vol/gcc/src/hg/master/local/gcc/cobol/parse.y:11412:8: error: ‘YYerror’ was
not declared in this scope; did you mean ‘yyerror’?
11412 | case YYerror: return "YYerror";
| ^~~~~~~
| yyerror
/vol/gcc/src/hg/master/local/gcc/cobol/parse.y:11413:8: error: ‘YYUNDEF’ was
not declared in this scope
11413 | case YYUNDEF: return "invalid token";
| ^~~~~~~
While both symbols are defined in parse.h when using bison 3.8.2, they are
missing with 3.5.1.
Either install.texi should be updated to document the corrent requirements
(it currently states that 3.5.1 is enough) or parse.y changed to avoid the
dependency.