yacc: declare yyerror/yylex only when POSIXLY_CORRECT
commit5d9ccd5a87f7991c6f52d45e2b57ad0b03e76cf7
authorAkim Demaille <akim.demaille@gmail.com>
Fri, 10 Sep 2021 04:48:02 +0000 (10 06:48 +0200)
committerAkim Demaille <akim.demaille@gmail.com>
Sat, 11 Sep 2021 06:26:10 +0000 (11 08:26 +0200)
tree88ac63f92f4d5d5519faf2d6321324a11aa355a1
parentad9b8a069ffaba0e93504b3414be16ba06b035ff
yacc: declare yyerror/yylex only when POSIXLY_CORRECT

The recent changes to comply with POSIX are breaking Automake's test
suite.
Reported by Kiyoshi Kanazawa.
<https://lists.gnu.org/r/bug-bison/2021-09/msg00005.html>

To limit the impact of POSIX changes, bind them to $POSIXLY_CORRECT.
Suggested by Karl Berry.
<https://lists.gnu.org/r/bug-bison/2021-09/msg00009.html>

The existing `maintainer-check-posix` Make target checks these
changes.

* src/getargs.h, src/getargs.c (set_yacc): New.
Use it.
* data/skeletons/bison.m4 (b4_posix_if): New.
* data/skeletons/yacc.c (b4_declare_yyerror_and_yylex): Use it.
* doc/bison.texi, tests/local.at: Adjust.
NEWS
data/skeletons/bison.m4
data/skeletons/yacc.c
doc/bison.texi
src/getargs.c
src/getargs.h
src/parse-gram.c
src/parse-gram.h
src/parse-gram.y
tests/calc.at
tests/local.at