GNU bug report logs - #50469
[bison-3.8] bug or side effect to flex & automake

Previous Next

Package: automake;

Reported by: Akim Demaille <akim <at> lrde.epita.fr>

Date: Wed, 8 Sep 2021 05:33:01 UTC

Severity: normal

Done: Karl Berry <karl <at> freefriends.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 50469 in the body.
You can then email your comments to 50469 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-automake <at> gnu.org:
bug#50469; Package automake. (Wed, 08 Sep 2021 05:33:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Akim Demaille <akim <at> lrde.epita.fr>:
New bug report received and forwarded. Copy sent to bug-automake <at> gnu.org. (Wed, 08 Sep 2021 05:33:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Akim Demaille <akim <at> lrde.epita.fr>
To: Kiyoshi KANAZAWA <yoi_no_myoujou <at> yahoo.co.jp>
Cc: Paul Eggert <eggert <at> CS.UCLA.EDU>, Automake Bugs <bug-automake <at> gnu.org>,
 Bison Bugs <bug-bison <at> gnu.org>
Subject: Re: [bison-3.8] bug or side effect to flex & automake
Date: Wed, 8 Sep 2021 07:31:28 +0200
Hi Kiyoshi,

> Le 8 sept. 2021 à 04:11, Kiyoshi KANAZAWA <yoi_no_myoujou <at> yahoo.co.jp> a écrit :
> 
> Hello,
> 
> Installed bison-3.8, but I'm afraid it is has bug or side effect to flex-2.6.4 & automake-1.16.4.
> 
> $ uname -a
> SunOS hidden 5.11 11.3 i86pc i386 i86pc
> 
> $ gcc --version
> gcc (GCC) 10.3.0
> 
> After installing bison-3.8, detected the following make check error, which did not with bison-3.7.6.
> 
> (1) flex-2.6.4
> mv -f $depbase.Tpo $depbase.Po
> depbase=`echo bison_nr_parser.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
> gcc -m32 -DHAVE_CONFIG_H -I. -I../src  -I../src -I../src    -MT bison_nr_parser.o -MD -MP -MF $depbase.Tpo -c -o bison_nr_parser.o bison_nr_parser.c &&\
> mv -f $depbase.Tpo $depbase.Po
> bison_nr_parser.c:70:25: error: conflicting types for 'testerror'
>    70 | #define yyerror         testerror
>       |                         ^~~~~~~~~
> bison_nr_parser.y:40:5: note: in expansion of macro 'yyerror'
>    40 | int yyerror(const char* msg);
>       |     ^~~~~~~
> In file included from bison_nr_parser.y:33:
> bison_nr_parser.h:110:6: note: previous declaration of 'testerror' was here
>   110 | void testerror (const YYLTYPE *yyllocp, const char *msg);
>       |      ^~~~~~~~~
> bison_nr_parser.c:70:25: error: conflicting types for 'testerror'
>    70 | #define yyerror         testerror
>       |                         ^~~~~~~~~
> bison_nr_parser.y:93:5: note: in expansion of macro 'yyerror'
>    93 | int yyerror(const char* msg) {
>       |     ^~~~~~~
> In file included from bison_nr_parser.y:33:
> bison_nr_parser.h:110:6: note: previous declaration of 'testerror' was here
>   110 | void testerror (const YYLTYPE *yyllocp, const char *msg);
>       |      ^~~~~~~~~
> make[2]: *** [Makefile:2076: bison_nr_parser.o] Error 1
> 
> And so on.

Well, I'm afraid this change was made on purpose, to conform with the (unfortunate IMHO) latest specs of POSIX Yacc.  See the NEWS file:

  To comply with the latest POSIX standard, in Yacc compatibility mode
  (options `-y`/`--yacc`) Bison now generates prototypes for yyerror and
  yylex.  In some situations, this is breaking compatibility: if the user
  has already declared these functions but with some differences (e.g., to
  declare them as static, or to use specific attributes), the generated
  parser will fail to compile.  To disable these prototypes, #define yyerror
  (to `yyerror`), and likewise for yylex.

This change in POSIX was discussed here: https://austingroupbugs.net/view.php?id=1388#c5220.  However, I don't see a published version of the POSIX Yacc "specs" that includes these changes.  The latest edition appears to be from 2018 (https://pubs.opengroup.org/onlinepubs/9699919799/).


That being said, several tests can be easily adjusted.  For instance t/silent-yacc fails because it provides this implementation of yyerror:

void yyerror (char *s) { return; }

while the expected signature is

void yyerror (const char *s);

I have not checked all the tests, but I suspect that many of them can be easily fixed.

I don't see you, Kiyoshi, in the logs of Automake, so I suppose you are not maintaining/contributing to Automake.  Yet we need to fix these tests (I'd be happy to get feedback from Automake's team on this).


This is definitely a change that may break compatibility in some cases, but it's out of our control: POSIX decided, we just comply.  One big problem with the Autotools as of today is that they promote the use of macros/build rules for Yacc, not for Bison.  Because of this, bison is almost always called with `-y/--yacc`, which not only forces bison to generate y.tab.c instead of foo.tab.c, but also forces it to enter the POSIX Yacc mode (and also to spit tons of warnings for each GNU Bison feature which is not part of POSIX Yacc).


Cheers!



Information forwarded to bug-automake <at> gnu.org:
bug#50469; Package automake. (Wed, 08 Sep 2021 06:35:02 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Akim Demaille <akim <at> lrde.epita.fr>,
 Kiyoshi KANAZAWA <yoi_no_myoujou <at> yahoo.co.jp>
Cc: Automake Bugs <bug-automake <at> gnu.org>, Bison Bugs <bug-bison <at> gnu.org>
Subject: Re: [bison-3.8] bug or side effect to flex & automake
Date: Tue, 7 Sep 2021 23:33:48 -0700
On 9/7/21 10:31 PM, Akim Demaille wrote:
> However, I don't see a published version of the POSIX Yacc "specs" that includes these changes.

The next POSIX revision is targeted for 2022, according to 
<http://www.opengroup.org/austin/papers/posix_faq.html>.

I suppose there is still opportunity to fix POSIX before the next 
revision comes out, but someone would have to create a bug report and 
submit it to the Austin Group.




Information forwarded to bug-automake <at> gnu.org:
bug#50469; Package automake. (Wed, 08 Sep 2021 14:54:03 GMT) Full text and rfc822 format available.

Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Zack Weinberg" <zack <at> owlfolio.org>
To: bug-automake <at> gnu.org
Cc: autoconf <at> gnu.org
Subject: Re: bug#50469: [bison-3.8] bug or side effect to flex & automake
Date: Wed, 08 Sep 2021 09:28:50 -0400
On Wed, Sep 8, 2021, at 1:31 AM, Akim Demaille wrote:
> One big problem with the Autotools as of today is that they promote
> the use of macros/build rules for Yacc, not for Bison.

The contract of AC_PROG_YACC is to find something that will generate
parsers from POSIX-compliant input; all three of bison, byacc, and
classic yacc are considered.

We would be happy to take contributions of AC_PROG_BISON (and
AC_PROG_FLEX), but as you know there isn’t anyone doing active
development of Autoconf right now, so it’s not going to happen without
someone stepping up.

zw




Information forwarded to bug-automake <at> gnu.org:
bug#50469; Package automake. (Wed, 08 Sep 2021 19:52:01 GMT) Full text and rfc822 format available.

Message #14 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Akim Demaille <akim <at> lrde.epita.fr>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: Kiyoshi KANAZAWA <yoi_no_myoujou <at> yahoo.co.jp>,
 Automake Bugs <bug-automake <at> gnu.org>, Bison Bugs <bug-bison <at> gnu.org>
Subject: Re: [bison-3.8] bug or side effect to flex & automake
Date: Wed, 8 Sep 2021 21:50:55 +0200
Hi Paul,

Thanks for the quick answer.

> Le 8 sept. 2021 à 08:33, Paul Eggert <eggert <at> cs.ucla.edu> a écrit :
> 
> On 9/7/21 10:31 PM, Akim Demaille wrote:
>> However, I don't see a published version of the POSIX Yacc "specs" that includes these changes.
> 
> The next POSIX revision is targeted for 2022, according to <http://www.opengroup.org/austin/papers/posix_faq.html>.

Thanks.  Last time we discussed about this, the conclusion was that Bison should implement this now.  Should we rather backtrack and postpone until the revision is published?  I have published 3.8, but not announced it yet, so it probably doesn't spread too fast.  I could revert that, and publish 3.8.1 very soon.

> I suppose there is still opportunity to fix POSIX before the next revision comes out, but someone would have to create a bug report and submit it to the Austin Group.

I don't see why this time they would agree not to change anything.  I believe we already clearly stated that this is a breaking change.



Information forwarded to bug-automake <at> gnu.org:
bug#50469; Package automake. (Wed, 08 Sep 2021 21:20:02 GMT) Full text and rfc822 format available.

Message #17 received at 50469 <at> debbugs.gnu.org (full text, mbox):

From: Karl Berry <karl <at> freefriends.org>
To: akim <at> lrde.epita.fr
Cc: 50469 <at> debbugs.gnu.org, yoi_no_myoujou <at> yahoo.co.jp, eggert <at> cs.ucla.edu,
 bug-bison <at> gnu.org
Subject: Re: bug#50469: [bison-3.8] bug or side effect to flex & automake
Date: Wed, 8 Sep 2021 15:18:58 -0600
    This is definitely a change that may break compatibility in some
    cases, but it's out of our control: POSIX decided, we just comply.

Just an idea that I don't expect you to adopt, but just to mention --
you could only institute the breaking change if POSIXLY_CORRECT.  That's
why POSIXLY_CORRECT exists. -k

P.S. Is this related to Automake? If it is, as with Autoconf, there
needs to be new volunteer effort to do what's needed. I can't take it on
and unfortunately no one else has come forward.




Information forwarded to bug-automake <at> gnu.org:
bug#50469; Package automake. (Wed, 08 Sep 2021 22:33:01 GMT) Full text and rfc822 format available.

Message #20 received at 50469 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Karl Berry <karl <at> freefriends.org>, akim <at> lrde.epita.fr
Cc: 50469 <at> debbugs.gnu.org, yoi_no_myoujou <at> yahoo.co.jp, bug-bison <at> gnu.org
Subject: Re: bug#50469: [bison-3.8] bug or side effect to flex & automake
Date: Wed, 8 Sep 2021 15:32:06 -0700
On 9/8/21 2:18 PM, Karl Berry wrote:
> Just an idea that I don't expect you to adopt, but just to mention --
> you could only institute the breaking change if POSIXLY_CORRECT.  That's
> why POSIXLY_CORRECT exists. -k

I like this idea. It insulates us against POSIX decisions and/or 
indecisions in this area.




Information forwarded to bug-automake <at> gnu.org:
bug#50469; Package automake. (Thu, 09 Sep 2021 05:12:02 GMT) Full text and rfc822 format available.

Message #23 received at 50469 <at> debbugs.gnu.org (full text, mbox):

From: Akim Demaille <akim <at> lrde.epita.fr>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 50469 <at> debbugs.gnu.org, Kiyoshi KANAZAWA <yoi_no_myoujou <at> yahoo.co.jp>,
 Bison Bugs <bug-bison <at> gnu.org>, Karl Berry <karl <at> freefriends.org>
Subject: Re: bug#50469: [bison-3.8] bug or side effect to flex & automake
Date: Thu, 9 Sep 2021 07:10:35 +0200
Hi!

> Le 9 sept. 2021 à 00:32, Paul Eggert <eggert <at> cs.ucla.edu> a écrit :
> 
> On 9/8/21 2:18 PM, Karl Berry wrote:
>> Just an idea that I don't expect you to adopt, but just to mention --
>> you could only institute the breaking change if POSIXLY_CORRECT.  That's
>> why POSIXLY_CORRECT exists. -k
> 
> I like this idea. It insulates us against POSIX decisions and/or indecisions in this area.

Good with me.  I'll implement that, thanks Karl!


>> P.S. Is this related to Automake? If it is, as with Autoconf, there
>> needs to be new volunteer effort to do what's needed. I can't take it on
>> and unfortunately no one else has come forward.

IMHO the prototypes in Automake's test suite are wrong: I see no reason for
yyerror to take a char *, and we do pass constant strings to it, so I'm
quite surprised that there are no compiling errors about it.  We should
fix that.  I can do that.

On the Autoconf side, we dearly need some AC_CHECK_BISON.  It is really a
pity that everybody uses AC_CHECK_YACC, which seriously degrades the point
of using bison.

Cheers!



Information forwarded to bug-automake <at> gnu.org:
bug#50469; Package automake. (Fri, 10 Sep 2021 16:42:01 GMT) Full text and rfc822 format available.

Message #26 received at 50469 <at> debbugs.gnu.org (full text, mbox):

From: Akim Demaille <akim <at> lrde.epita.fr>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 50469 <at> debbugs.gnu.org, Kiyoshi KANAZAWA <yoi_no_myoujou <at> yahoo.co.jp>,
 Bison Bugs <bug-bison <at> gnu.org>, Karl Berry <karl <at> freefriends.org>
Subject: Re: bug#50469: [bison-3.8] bug or side effect to flex & automake
Date: Fri, 10 Sep 2021 18:40:57 +0200
Hi all,

> Le 9 sept. 2021 à 07:10, Akim Demaille <akim <at> lrde.epita.fr> a écrit :
> 
> Hi!
> 
>> Le 9 sept. 2021 à 00:32, Paul Eggert <eggert <at> cs.ucla.edu> a écrit :
>> 
>> On 9/8/21 2:18 PM, Karl Berry wrote:
>>> Just an idea that I don't expect you to adopt, but just to mention --
>>> you could only institute the breaking change if POSIXLY_CORRECT.  That's
>>> why POSIXLY_CORRECT exists. -k
>> 
>> I like this idea. It insulates us against POSIX decisions and/or indecisions in this area.
> 
> Good with me.  I'll implement that, thanks Karl!

I will soon push the following commit, and wrap a 3.8.1.  Comments most welcome!

Cheers!

(a tarball is available here:

  https://www.lrde.epita.fr/~akim/private/bison/bison-3.8.3-84b7.tar.gz
  https://www.lrde.epita.fr/~akim/private/bison/bison-3.8.3-84b7.tar.lz
  https://www.lrde.epita.fr/~akim/private/bison/bison-3.8.3-84b7.tar.xz)

commit 5623009a76dd8f04b5c19bb5f6ae8e2bf258a51e
Author: Akim Demaille <akim.demaille <at> gmail.com>
Date:   Fri Sep 10 06:48:02 2021 +0200

    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.

diff --git a/NEWS b/NEWS
index 71c4ae7c..8300548a 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,15 @@ GNU Bison NEWS
 
 * Noteworthy changes in release ?.? (????-??-??) [?]
 
+  The generation of prototypes for yylex and yyerror in Yacc mode is
+  breaking existing grammar files.
+
+  **Please don't use `-y`/`--yacc` simply to comply with Yacc's file name
+    conventions, rather, use `-o y.tab.c`.**
+
+  To avoid breaking too many grammars, the prototypes are now generated when
+  `-y/--yacc` is used *and* the `POSIXLY_CORRECT` environment variable is
+  defined.
 
 * Noteworthy changes in release 3.8 (2021-09-07) [stable]
 
@@ -4706,7 +4715,7 @@ LocalWords:  autocompletion bistromathic submessages Cayuela lexcalc hoc
 LocalWords:  yytoken YYUNDEF YYerror basename Automake's UTF ifdef ffile
 LocalWords:  gotos readline Imbimbo Wcounterexamples Wcex Nonunifying rcex
 LocalWords:  Vais xsltproc YYNOMEM YYLOCATION signedness YYBISON MITRE's
-LocalWords:  libreadline YYMALLOC YYFREE MSVC redefinitions
+LocalWords:  libreadline YYMALLOC YYFREE MSVC redefinitions POSIXLY
 
 Local Variables:
 ispell-dictionary: "american"
diff --git a/data/skeletons/bison.m4 b/data/skeletons/bison.m4
index 488ad610..037dadcf 100644
--- a/data/skeletons/bison.m4
+++ b/data/skeletons/bison.m4
@@ -1110,6 +1110,7 @@ b4_percent_define_if_define([token_ctor], [api.token.constructor])
 b4_percent_define_if_define([locations])     # Whether locations are tracked.
 b4_percent_define_if_define([parse.assert])
 b4_percent_define_if_define([parse.trace])
+b4_percent_define_if_define([posix])
 
 
 # b4_bison_locations_if([IF-TRUE])
diff --git a/data/skeletons/yacc.c b/data/skeletons/yacc.c
index d50f3aaf..64b9ac62 100644
--- a/data/skeletons/yacc.c
+++ b/data/skeletons/yacc.c
@@ -367,7 +367,7 @@ m4_define([b4_declare_yyparse],
 # Comply with POSIX Yacc.
 # <https://austingroupbugs.net/view.php?id=1388#c5220>
 m4_define([b4_declare_yyerror_and_yylex],
-[b4_yacc_if([[#if !defined ]b4_prefix[error && !defined ]b4_api_PREFIX[ERROR_IS_DECLARED
+[b4_posix_if([[#if !defined ]b4_prefix[error && !defined ]b4_api_PREFIX[ERROR_IS_DECLARED
 ]b4_function_declare([b4_prefix[error]], void, b4_yyerror_formals)[
 #endif
 #if !defined ]b4_prefix[lex && !defined ]b4_api_PREFIX[LEX_IS_DECLARED
diff --git a/doc/bison.texi b/doc/bison.texi
index 9a02fb95..a559649c 100644
--- a/doc/bison.texi
+++ b/doc/bison.texi
@@ -11877,7 +11877,10 @@ @node Tuning the Parser
 Generate @code{#define} statements in addition to an @code{enum} to
 associate token codes with token kind names.
 @item
-Generate prototypes for @code{yyerror} and @code{yylex} (since Bison 3.8):
+If the @code{POSIXLY_CORRECT} environment variable is defined, generate
+prototypes for @code{yyerror} and @code{yylex}@footnote{See
+@url{https://austingroupbugs.net/view.php?id=1388#c5220}.} (since Bison
+3.8):
 @example
 int yylex (void);
 void yyerror (const char *);
diff --git a/src/getargs.c b/src/getargs.c
index 697ad7eb..ef559296 100644
--- a/src/getargs.c
+++ b/src/getargs.c
@@ -71,6 +71,18 @@ struct bison_language const *language = &valid_languages[0];
 
 typedef int* (xargmatch_fn) (const char *context, const char *arg);
 
+void
+set_yacc (location loc)
+{
+  yacc_loc = loc;
+  if (getenv ("POSIXLY_CORRECT"))
+    muscle_percent_define_insert ("posix",
+                                  loc,
+                                  muscle_keyword, "",
+                                  MUSCLE_PERCENT_DEFINE_D);
+}
+
+
 /** Decode an option's key.
  *
  *  \param opt        option being decoded.
@@ -631,8 +643,7 @@ static struct option const long_options[] =
 };
 
 /* Build a location for the current command line argument. */
-static
-location
+static location
 command_line_location (void)
 {
   location res;
@@ -835,7 +846,7 @@ getargs (int argc, char *argv[])
 
       case 'y':
         warning_argmatch ("yacc", 0, 0);
-        yacc_loc = loc;
+        set_yacc (loc);
         break;
 
       case COLOR_OPTION:
diff --git a/src/getargs.h b/src/getargs.h
index a26aec2f..836c1290 100644
--- a/src/getargs.h
+++ b/src/getargs.h
@@ -140,6 +140,7 @@ void getargs (int argc, char *argv[]);
 /* Used by parse-gram.y.  */
 void language_argmatch (char const *arg, int prio, location loc);
 void skeleton_arg (const char *arg, int prio, location loc);
+void set_yacc (location loc);
 
 /** In the string \c s, replace all characters \c from by \c to.  */
 void tr (char *s, char from, char to);
diff --git a/src/parse-gram.c b/src/parse-gram.c
index 95fe43e0..3bc44dbd 100644
--- a/src/parse-gram.c
+++ b/src/parse-gram.c
@@ -1,4 +1,4 @@
-/* A Bison parser, made by GNU Bison 3.7.5.297-b46a.  */
+/* A Bison parser, made by GNU Bison 3.8.  */
 
 /* Bison implementation for Yacc-like parsers in C
 
@@ -46,10 +46,10 @@
    USER NAME SPACE" below.  */
 
 /* Identify Bison output, and Bison version.  */
-#define YYBISON 30705
+#define YYBISON 30800
 
 /* Bison version string.  */
-#define YYBISON_VERSION "3.7.5.297-b46a"
+#define YYBISON_VERSION "3.8"
 
 /* Skeleton name.  */
 #define YYSKELETON_NAME "yacc.c"
@@ -3129,7 +3129,7 @@ handle_yacc (location const *loc)
   const char *directive = "%yacc";
   bison_directive (loc, directive);
   if (location_empty (yacc_loc))
-    yacc_loc = *loc;
+    set_yacc (*loc);
   else
     duplicate_directive (directive, yacc_loc, *loc);
 }
diff --git a/src/parse-gram.h b/src/parse-gram.h
index 10a63528..77849263 100644
--- a/src/parse-gram.h
+++ b/src/parse-gram.h
@@ -1,4 +1,4 @@
-/* A Bison parser, made by GNU Bison 3.7.5.297-b46a.  */
+/* A Bison parser, made by GNU Bison 3.8.  */
 
 /* Bison interface for Yacc-like parsers in C
 
@@ -215,6 +215,7 @@ struct GRAM_LTYPE
 
 
 
+
 int gram_parse (void);
 
 /* "%code provides" blocks.  */
diff --git a/src/parse-gram.y b/src/parse-gram.y
index 1de83d02..15180cb5 100644
--- a/src/parse-gram.y
+++ b/src/parse-gram.y
@@ -1112,7 +1112,7 @@ handle_yacc (location const *loc)
   const char *directive = "%yacc";
   bison_directive (loc, directive);
   if (location_empty (yacc_loc))
-    yacc_loc = *loc;
+    set_yacc (*loc);
   else
     duplicate_directive (directive, yacc_loc, *loc);
 }
diff --git a/tests/calc.at b/tests/calc.at
index 11801543..aeac8418 100644
--- a/tests/calc.at
+++ b/tests/calc.at
@@ -268,7 +268,7 @@ m4_define([AT_CALC_YYLEX(c)],
 
 
 m4_define([_AT_DATA_CALC_Y(c)],
-[AT_DATA_GRAMMAR([calc.y],
+[AT_DATA_GRAMMAR([calc.y.tmp],
 [[/* Infix notation calculator--calc */
 ]$4[
 %code requires
@@ -493,6 +493,18 @@ m4_define([_AT_DATA_CALC_Y(c)],
 [AT_CALC_YYLEX
 AT_CALC_MAIN])])
 
+# Remove the generated prototypes.
+AT_CHECK(
+  [AT_YACC_IF([[
+    if "$POSIXLY_CORRECT_IS_EXPORTED"; then
+      sed -e '/\/\* !POSIX \*\//d' calc.y.tmp >calc.y
+    else
+      mv calc.y.tmp calc.y
+    fi
+  ]],
+  [[mv calc.y.tmp calc.y]])
+])
+
 AT_HEADER_IF([AT_DATA_SOURCE([[calc-lex.]AT_LANG_EXT],
 [[#include "calc.]AT_LANG_HDR["
 
diff --git a/tests/local.at b/tests/local.at
index bc43ee1c..adde4e4c 100644
--- a/tests/local.at
+++ b/tests/local.at
@@ -687,8 +687,8 @@ m4_define([AT_YYERROR_DECLARE_EXTERN(c)],
 m4_define([AT_YYERROR_DECLARE(c)],
 [[#include <stdio.h>
 ]AT_LOCATION_PRINT_DECLARE[
-]AT_YACC_IF([], [[static ]AT_YYERROR_DECLARE_EXTERN])])
-
+/* !POSIX */ static ]AT_YYERROR_DECLARE_EXTERN[]dnl
+])
 
 # "%define parse.error custom" uses a different format, easy to check.
 # The "verbose" one can be computed from it (see _AT_CHECK_CALC_ERROR).
@@ -733,7 +733,7 @@ m4_define([AT_YYERROR_DEFINE(c)],
 ]])[
 
 /* A C error reporting function.  */
-]AT_YACC_IF([], [static])[
+/* !POSIX */ static
 ]AT_YYERROR_PROTOTYPE[
 {]m4_bpatsubst(m4_defn([AT_PARSE_PARAMS]),
               [[^,]+[^A-Za-z_0-9]\([A-Za-z_][A-Za-z_0-9]*\),* *], [





Information forwarded to bug-automake <at> gnu.org:
bug#50469; Package automake. (Fri, 10 Sep 2021 17:39:02 GMT) Full text and rfc822 format available.

Message #29 received at 50469 <at> debbugs.gnu.org (full text, mbox):

From: Sam James <sam <at> cmpct.info>
To: Akim Demaille <akim <at> lrde.epita.fr>
Cc: 50469 <at> debbugs.gnu.org, Kiyoshi KANAZAWA <yoi_no_myoujou <at> yahoo.co.jp>,
 Paul Eggert <eggert <at> cs.ucla.edu>, Bison Bugs <bug-bison <at> gnu.org>,
 Karl Berry <karl <at> freefriends.org>
Subject: Re: bug#50469: [bison-3.8] bug or side effect to flex & automake
Date: Fri, 10 Sep 2021 17:51:31 +0100
[Message part 1 (text/plain, inline)]

> On 10 Sep 2021, at 17:40, Akim Demaille <akim <at> lrde.epita.fr> wrote:
> 
> Hi all,
> 
>> Le 9 sept. 2021 à 07:10, Akim Demaille <akim <at> lrde.epita.fr> a écrit :
>> 
>> Hi!
>> 
>>> Le 9 sept. 2021 à 00:32, Paul Eggert <eggert <at> cs.ucla.edu> a écrit :
>>> 
>>> On 9/8/21 2:18 PM, Karl Berry wrote:
>>>> Just an idea that I don't expect you to adopt, but just to mention --
>>>> you could only institute the breaking change if POSIXLY_CORRECT.  That's
>>>> why POSIXLY_CORRECT exists. -k
>>> 
>>> I like this idea. It insulates us against POSIX decisions and/or indecisions in this area.
>> 
>> Good with me.  I'll implement that, thanks Karl!
> 
> I will soon push the following commit, and wrap a 3.8.1.  Comments most welcome!
> 
> Cheers!
> 
> (a tarball is available here:
> 
>  https://www.lrde.epita.fr/~akim/private/bison/bison-3.8.3-84b7.tar.gz
>  https://www.lrde.epita.fr/~akim/private/bison/bison-3.8.3-84b7.tar.lz
>  https://www.lrde.epita.fr/~akim/private/bison/bison-3.8.3-84b7.tar.xz)
> 
> [snip]

Thanks your work on this! Brief comments on version changes:

> diff --git a/src/getargs.c b/src/getargs.c
> index 697ad7eb..ef559296 100644
> --- a/src/getargs.c
> +++ b/src/getargs.c
> @@ -71,6 +71,18 @@ struct bison_language const *language = &valid_languages[0];
> 
> typedef int* (xargmatch_fn) (const char *context, const char *arg);
> 
> +void
> +set_yacc (location loc)
> +{
> +  yacc_loc = loc;
> +  if (getenv ("POSIXLY_CORRECT"))
> +    muscle_percent_define_insert ("posix",
> +                                  loc,
> +                                  muscle_keyword, "",
> +                                  MUSCLE_PERCENT_DEFINE_D);
> +}
> +
> +
> /** Decode an option's key.
>  *
>  *  \param opt        option being decoded.
> @@ -631,8 +643,7 @@ static struct option const long_options[] =
> };
> 
> /* Build a location for the current command line argument. */
> -static
> -location
> +static location
> command_line_location (void)
> {
>   location res;
> @@ -835,7 +846,7 @@ getargs (int argc, char *argv[])
> 
>       case 'y':
>         warning_argmatch ("yacc", 0, 0);
> -        yacc_loc = loc;
> +        set_yacc (loc);
>         break;
> 
>       case COLOR_OPTION:
> diff --git a/src/getargs.h b/src/getargs.h
> index a26aec2f..836c1290 100644
> --- a/src/getargs.h
> +++ b/src/getargs.h
> @@ -140,6 +140,7 @@ void getargs (int argc, char *argv[]);
> /* Used by parse-gram.y.  */
> void language_argmatch (char const *arg, int prio, location loc);
> void skeleton_arg (const char *arg, int prio, location loc);
> +void set_yacc (location loc);
> 
> /** In the string \c s, replace all characters \c from by \c to.  */
> void tr (char *s, char from, char to);
> diff --git a/src/parse-gram.c b/src/parse-gram.c
> index 95fe43e0..3bc44dbd 100644
> --- a/src/parse-gram.c
> +++ b/src/parse-gram.c
> @@ -1,4 +1,4 @@
> -/* A Bison parser, made by GNU Bison 3.7.5.297-b46a.  */
> +/* A Bison parser, made by GNU Bison 3.8.  */

3.8 -> 3.8.1, but I guess this will be automatic :)

> 
> /* Bison implementation for Yacc-like parsers in C
> 
> @@ -46,10 +46,10 @@
>    USER NAME SPACE" below.  */
> 
> /* Identify Bison output, and Bison version.  */
> -#define YYBISON 30705
> +#define YYBISON 30800

Needs adjusting or not?

> 
> /* Bison version string.  */
> -#define YYBISON_VERSION "3.7.5.297-b46a"
> +#define YYBISON_VERSION "3.8"
> 

3.8.1?

> /* Skeleton name.  */
> #define YYSKELETON_NAME "yacc.c"
> @@ -3129,7 +3129,7 @@ handle_yacc (location const *loc)
>   const char *directive = "%yacc";
>   bison_directive (loc, directive);
>   if (location_empty (yacc_loc))
> -    yacc_loc = *loc;
> +    set_yacc (*loc);
>   else
>     duplicate_directive (directive, yacc_loc, *loc);
> }
> diff --git a/src/parse-gram.h b/src/parse-gram.h
> index 10a63528..77849263 100644
> --- a/src/parse-gram.h
> +++ b/src/parse-gram.h
> @@ -1,4 +1,4 @@
> -/* A Bison parser, made by GNU Bison 3.7.5.297-b46a.  */
> +/* A Bison parser, made by GNU Bison 3.8.  */
> 
> /* Bison interface for Yacc-like parsers in C
> 
> @@ -215,6 +215,7 @@ struct GRAM_LTYPE
> 
> 
> 
> +
> int gram_parse (void);
> 
> /* "%code provides" blocks.  */
> diff --git a/src/parse-gram.y b/src/parse-gram.y
> index 1de83d02..15180cb5 100644
> --- a/src/parse-gram.y
> +++ b/src/parse-gram.y
> @@ -1112,7 +1112,7 @@ handle_yacc (location const *loc)
>   const char *directive = "%yacc";
>   bison_directive (loc, directive);
>   if (location_empty (yacc_loc))
> -    yacc_loc = *loc;
> +    set_yacc (*loc);
>   else
>     duplicate_directive (directive, yacc_loc, *loc);
> }
> diff --git a/tests/calc.at b/tests/calc.at
> index 11801543..aeac8418 100644
> --- a/tests/calc.at
> +++ b/tests/calc.at
> @@ -268,7 +268,7 @@ m4_define([AT_CALC_YYLEX(c)],
> 
> 
> m4_define([_AT_DATA_CALC_Y(c)],
> -[AT_DATA_GRAMMAR([calc.y],
> +[AT_DATA_GRAMMAR([calc.y.tmp],
> [[/* Infix notation calculator--calc */
> ]$4[
> %code requires
> @@ -493,6 +493,18 @@ m4_define([_AT_DATA_CALC_Y(c)],
> [AT_CALC_YYLEX
> AT_CALC_MAIN])])
> 
> +# Remove the generated prototypes.
> +AT_CHECK(
> +  [AT_YACC_IF([[
> +    if "$POSIXLY_CORRECT_IS_EXPORTED"; then
> +      sed -e '/\/\* !POSIX \*\//d' calc.y.tmp >calc.y
> +    else
> +      mv calc.y.tmp calc.y
> +    fi
> +  ]],
> +  [[mv calc.y.tmp calc.y]])
> +])
> +
> AT_HEADER_IF([AT_DATA_SOURCE([[calc-lex.]AT_LANG_EXT],
> [[#include "calc.]AT_LANG_HDR["
> 
> diff --git a/tests/local.at b/tests/local.at
> index bc43ee1c..adde4e4c 100644
> --- a/tests/local.at
> +++ b/tests/local.at
> @@ -687,8 +687,8 @@ m4_define([AT_YYERROR_DECLARE_EXTERN(c)],
> m4_define([AT_YYERROR_DECLARE(c)],
> [[#include <stdio.h>
> ]AT_LOCATION_PRINT_DECLARE[
> -]AT_YACC_IF([], [[static ]AT_YYERROR_DECLARE_EXTERN])])
> -
> +/* !POSIX */ static ]AT_YYERROR_DECLARE_EXTERN[]dnl
> +])
> 
> # "%define parse.error custom" uses a different format, easy to check.
> # The "verbose" one can be computed from it (see _AT_CHECK_CALC_ERROR).
> @@ -733,7 +733,7 @@ m4_define([AT_YYERROR_DEFINE(c)],
> ]])[
> 
> /* A C error reporting function.  */
> -]AT_YACC_IF([], [static])[
> +/* !POSIX */ static
> ]AT_YYERROR_PROTOTYPE[
> {]m4_bpatsubst(m4_defn([AT_PARSE_PARAMS]),
>               [[^,]+[^A-Za-z_0-9]\([A-Za-z_][A-Za-z_0-9]*\),* *], [
> 
> 
> 
> 

[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-automake <at> gnu.org:
bug#50469; Package automake. (Sat, 11 Sep 2021 05:48:02 GMT) Full text and rfc822 format available.

Message #32 received at 50469 <at> debbugs.gnu.org (full text, mbox):

From: Akim Demaille <akim <at> lrde.epita.fr>
To: Sam James <sam <at> cmpct.info>
Cc: 50469 <at> debbugs.gnu.org, Kiyoshi KANAZAWA <yoi_no_myoujou <at> yahoo.co.jp>,
 Paul Eggert <eggert <at> cs.ucla.edu>, Bison Bugs <bug-bison <at> gnu.org>,
 Karl Berry <karl <at> freefriends.org>
Subject: Re: bug#50469: [bison-3.8] bug or side effect to flex & automake
Date: Sat, 11 Sep 2021 07:46:14 +0200
Hi Sam,

> Le 10 sept. 2021 à 18:51, Sam James <sam <at> cmpct.info> a écrit :
> 
> Thanks your work on this! Brief comments on version changes:
> 
>> diff --git a/src/parse-gram.c b/src/parse-gram.c
>> index 95fe43e0..3bc44dbd 100644
>> --- a/src/parse-gram.c
>> +++ b/src/parse-gram.c
>> @@ -1,4 +1,4 @@
>> -/* A Bison parser, made by GNU Bison 3.7.5.297-b46a.  */
>> +/* A Bison parser, made by GNU Bison 3.8.  */
> 
> 3.8 -> 3.8.1, but I guess this will be automatic :)

This is indeed automatic, but refers to the version of Bison that was used to generate bison's parser.  So there's nothing wrong here.

Cheers!



Information forwarded to bug-automake <at> gnu.org:
bug#50469; Package automake. (Sat, 11 Sep 2021 08:08:01 GMT) Full text and rfc822 format available.

Message #35 received at 50469 <at> debbugs.gnu.org (full text, mbox):

From: Akim Demaille <akim <at> lrde.epita.fr>
To: Sam James <sam <at> cmpct.info>
Cc: 50469 <at> debbugs.gnu.org, Kiyoshi KANAZAWA <yoi_no_myoujou <at> yahoo.co.jp>,
 Paul Eggert <eggert <at> cs.ucla.edu>, Bison Bugs <bug-bison <at> gnu.org>,
 Karl Berry <karl <at> freefriends.org>
Subject: Re: bug#50469: [bison-3.8] bug or side effect to flex & automake
Date: Sat, 11 Sep 2021 10:06:13 +0200
I propose the following patch to fix Automake's prototype of yyerror.

Cheers!

commit 38242845a146d6438e3f884100aa3e670142e393
Author: Akim Demaille <akim.demaille <at> gmail.com>
Date:   Sat Sep 11 09:39:00 2021 +0200

    tests: let yacc's yyerror take its argument as a const string
    
    Some of yacc error messages are const strings, it makes no sense for yyerror
    to take a `char*`, it should be a `const char*`.
    
    Fixes all the failures reported by Kiyoshi Kanazawa.
    <https://lists.gnu.org/r/bug-bison/2021-09/msg00005.html>
    See bug#50469.
    
    * t/cond35.sh, t/silent-many-languages.sh, t/silent-yacc-headers.sh,
    * t/silent-yacc.sh, t/subpkg-yacc.sh, t/suffix10.tap, t/yacc-basic.sh,
    * t/yacc-clean.sh, t/yacc-d-basic.sh, t/yacc-d-vpath.sh,
    * t/yacc-deleted-headers.sh, t/yacc-depend.sh, t/yacc-depend2.sh,
    * t/yacc-dist-nobuild-subdir.sh, t/yacc-dist-nobuild.sh, t/yacc-dry.sh,
    * t/yacc-line.sh, t/yacc-misc.sh, t/yacc-mix-c-cxx.sh, t/yacc-nodist.sh,
    * t/yacc-pr204.sh, t/yacc-subdir.sh, t/yacc-vpath.sh,
    * t/yflags-cmdline-override.sh, t/yflags-force-override.sh
    (yyerror): From `char*` to `const char*`.
    Enforce consistency: prefer `{}` to `{ return; }`.

diff --git a/t/cond35.sh b/t/cond35.sh
index 786bb3cf5..37a25eae3 100644
--- a/t/cond35.sh
+++ b/t/cond35.sh
@@ -73,7 +73,7 @@ END
 
 cat > tparse.y << 'END'
 %{
-void yyerror (char *s) {}
+void yyerror (const char *s) {}
 %}
 %token EOF
 %%
diff --git a/t/silent-many-languages.sh b/t/silent-many-languages.sh
index edb59e7c9..9361b2bf8 100644
--- a/t/silent-many-languages.sh
+++ b/t/silent-many-languages.sh
@@ -188,7 +188,7 @@ EOF
 cat > foo6.y <<'EOF'
 %{
 extern int yylex (void);
-void yyerror (char *s) {}
+void yyerror (const char *s) {}
 %}
 %token EOF
 %%
diff --git a/t/silent-yacc-headers.sh b/t/silent-yacc-headers.sh
index c10fc5cc4..0582973f5 100644
--- a/t/silent-yacc-headers.sh
+++ b/t/silent-yacc-headers.sh
@@ -39,7 +39,7 @@ EOF
 
 cat > parse.y <<'EOF'
 %{
-void yyerror (char *s) { return; }
+void yyerror (const char *s) {}
 int yylex (void) { return 0; }
 int main (void) { return 0; }
 %}
diff --git a/t/silent-yacc.sh b/t/silent-yacc.sh
index d11fc2ab2..3254d4014 100644
--- a/t/silent-yacc.sh
+++ b/t/silent-yacc.sh
@@ -50,7 +50,7 @@ EOF
 
 cat > foo.y <<'EOF'
 %{
-void yyerror (char *s) { return; }
+void yyerror (const char *s) {}
 int yylex (void) { return 0; }
 int main (void) { return 0; }
 %}
diff --git a/t/subpkg-yacc.sh b/t/subpkg-yacc.sh
index eac56cb1f..9e31c5151 100644
--- a/t/subpkg-yacc.sh
+++ b/t/subpkg-yacc.sh
@@ -88,7 +88,7 @@ EOF
 cat > lib/foo.y << 'END'
 %{
 int yylex (void) { return 0; }
-void yyerror (char *s) {}
+void yyerror (const char *s) {}
 %}
 %%
 foobar : 'f' 'o' 'o' 'b' 'a' 'r' {};
diff --git a/t/suffix10.tap b/t/suffix10.tap
index 2258120e7..d233c6c21 100644
--- a/t/suffix10.tap
+++ b/t/suffix10.tap
@@ -39,7 +39,7 @@ libfoo_la_SOURCES = foo.x_
 	:; { echo '/* autogenerated */' \
 	  && echo '%{' \
 	  && echo 'int yylex () {return 0;}' \
-	  && echo 'void yyerror (char *s) {}' \
+	  && echo 'void yyerror (const char *s) {}' \
 	  && echo '%}' \
 	  && echo '%%' \
 	  && echo "foobar : 'f' 'o' 'o' 'b' 'a' 'r' {};" \
diff --git a/t/yacc-basic.sh b/t/yacc-basic.sh
index cfbaa1957..d50157099 100644
--- a/t/yacc-basic.sh
+++ b/t/yacc-basic.sh
@@ -42,7 +42,7 @@ cat > parse.y << 'END'
 #include <stdio.h>
 #include <stdlib.h>
 int yylex () { return getchar (); }
-void yyerror (char *s) {}
+void yyerror (const char *s) {}
 %}
 %%
 a : 'a' { exit(0); };
diff --git a/t/yacc-bison-skeleton.sh b/t/yacc-bison-skeleton.sh
index 60e85dd85..6069489da 100644
--- a/t/yacc-bison-skeleton.sh
+++ b/t/yacc-bison-skeleton.sh
@@ -44,7 +44,7 @@ void yyerror (const char *s);
 foobar : 'f' 'o' 'o' 'b' 'a' 'r' {};
 %%
 int yylex () { return 0; }
-void yyerror (const char *s) { return; }
+void yyerror (const char *s) {}
 END
 
 cat > foo.c << 'END'
diff --git a/t/yacc-clean-cxx.sh b/t/yacc-clean-cxx.sh
index fe2795894..811d46939 100644
--- a/t/yacc-clean-cxx.sh
+++ b/t/yacc-clean-cxx.sh
@@ -70,7 +70,7 @@ cat > sub1/parsefoo.yxx << 'END'
 #include <cstdio>
 // "std::" qualification required by Sun C++ 5.9.
 int yylex (void) { return std::getchar (); }
-void yyerror (const char *s) { return; }
+void yyerror (const char *s) {}
 %}
 %%
 x : 'x' { };
diff --git a/t/yacc-clean.sh b/t/yacc-clean.sh
index 9ea13a704..c248e5c89 100644
--- a/t/yacc-clean.sh
+++ b/t/yacc-clean.sh
@@ -66,7 +66,7 @@ END
 cat > sub1/parse.y << 'END'
 %{
 int yylex () { return (getchar ()); }
-void yyerror (char *s) {}
+void yyerror (const char *s) {}
 %}
 %%
 x : 'x' { };
diff --git a/t/yacc-cxx.sh b/t/yacc-cxx.sh
index 0e163eb44..b9dcd458b 100644
--- a/t/yacc-cxx.sh
+++ b/t/yacc-cxx.sh
@@ -48,7 +48,7 @@ cat > parse1.yy << 'END'
 #include <cstdlib>
 // "std::" qualification required by Sun C++ 5.9.
 int yylex (void) { return std::getchar (); }
-void yyerror (const char *s) { return; }
+void yyerror (const char *s) {}
 %}
 %%
 a : 'a' { exit(0); };
diff --git a/t/yacc-d-basic.sh b/t/yacc-d-basic.sh
index 66c11063e..b468d5532 100644
--- a/t/yacc-d-basic.sh
+++ b/t/yacc-d-basic.sh
@@ -48,7 +48,7 @@ cat > foo/parse.y << 'END'
 %{
 #include "parse.h"
 int yylex () { return 0; }
-void yyerror (char *s) {}
+void yyerror (const char *s) {}
 %}
 %%
 x : 'x' {};
diff --git a/t/yacc-d-vpath.sh b/t/yacc-d-vpath.sh
index e0fb951f2..86ae07b0c 100644
--- a/t/yacc-d-vpath.sh
+++ b/t/yacc-d-vpath.sh
@@ -41,7 +41,7 @@ END
 cat > parse.y << 'END'
 %{
 int yylex () { return 0; }
-void yyerror (char *s) {}
+void yyerror (const char *s) {}
 %}
 %token FOOBAR
 %%
@@ -74,7 +74,7 @@ $sleep
 cat > ../parse.y << 'END'
 %{
 int yylex () { return 0; }
-void yyerror (char *s) {}
+void yyerror (const char *s) {}
 %}
 %token FUBAR
 %%
@@ -94,7 +94,7 @@ $sleep
 cat > ../parse.y << 'END'
 %{
 int yylex () { return 0; }
-void yyerror (char *s) {}
+void yyerror (const char *s) {}
 %}
 %token MAUDE
 %%
diff --git a/t/yacc-deleted-headers.sh b/t/yacc-deleted-headers.sh
index 766caac5c..5b661d1e5 100644
--- a/t/yacc-deleted-headers.sh
+++ b/t/yacc-deleted-headers.sh
@@ -56,7 +56,7 @@ cat > parse1.y << 'END'
 %{
 #include "parse1.h"
 int yylex () { return 0; }
-void yyerror (char *s) { return; }
+void yyerror (const char *s) {}
 %}
 %token ZARDOZ
 %%
@@ -81,7 +81,7 @@ sed 's/"parse1\.h"/"parse3.h"/' main1.c > main3.c
 cat > parse4.y << 'END'
 %{
 int yylex () { return 0; }
-void yyerror (char *s) { return; }
+void yyerror (const char *s) {}
 %}
 %%
 x : 'x' {};
diff --git a/t/yacc-depend.sh b/t/yacc-depend.sh
index 27c704b3d..dc82a316a 100644
--- a/t/yacc-depend.sh
+++ b/t/yacc-depend.sh
@@ -36,7 +36,7 @@ END
 cat > foo.y << 'END'
 %{
 int yylex () { return 0; }
-void yyerror (char *s) { return; }
+void yyerror (const char *s) {}
 %}
 %token TOKEN
 %%
diff --git a/t/yacc-depend2.sh b/t/yacc-depend2.sh
index ce730f42b..c2b1b9be5 100644
--- a/t/yacc-depend2.sh
+++ b/t/yacc-depend2.sh
@@ -42,7 +42,7 @@ END
 cat > foo.y << 'END'
 %{
 int yylex () { return 0; }
-void yyerror (char *s) { return; }
+void yyerror (const char *s) {}
 %}
 %token TOKEN
 %%
diff --git a/t/yacc-dist-nobuild-subdir.sh b/t/yacc-dist-nobuild-subdir.sh
index c918c3996..8b15d2c2a 100644
--- a/t/yacc-dist-nobuild-subdir.sh
+++ b/t/yacc-dist-nobuild-subdir.sh
@@ -36,7 +36,7 @@ mkdir sub
 cat > sub/parse.y << 'END'
 %{
 int yylex () { return 0; }
-void yyerror (char *s) { return; }
+void yyerror (const char *s) {}
 %}
 %%
 x : 'x' {};
diff --git a/t/yacc-dist-nobuild.sh b/t/yacc-dist-nobuild.sh
index 5e1a2a70a..f4d3fbcb2 100644
--- a/t/yacc-dist-nobuild.sh
+++ b/t/yacc-dist-nobuild.sh
@@ -37,7 +37,7 @@ END
 cat > parse.y << 'END'
 %{
 int yylex () { return 0; }
-void yyerror (char *s) {}
+void yyerror (const char *s) {}
 %}
 %%
 foobar : 'f' 'o' 'o' 'b' 'a' 'r' {};
diff --git a/t/yacc-dry.sh b/t/yacc-dry.sh
index c9c1aa2e0..43e1422a6 100644
--- a/t/yacc-dry.sh
+++ b/t/yacc-dry.sh
@@ -38,7 +38,7 @@ END
 cat > parse.y << 'END'
 %{
 int yylex () { return 0; }
-void yyerror (char *s) {}
+void yyerror (const char *s) {}
 %}
 %%
 foobar : 'f' 'o' 'o' 'b' 'a' 'r' {};
diff --git a/t/yacc-line.sh b/t/yacc-line.sh
index 10e8a8cd4..ef48d83c5 100644
--- a/t/yacc-line.sh
+++ b/t/yacc-line.sh
@@ -57,7 +57,7 @@ END
 cat > zardoz.y << 'END'
 %{
 int yylex () { return 0; }
-void yyerror (char *s) { return; }
+void yyerror (const char *s) {}
 %}
 %%
 x : 'x' {};
diff --git a/t/yacc-misc.sh b/t/yacc-misc.sh
index 2371a099f..9dc8f9dfd 100644
--- a/t/yacc-misc.sh
+++ b/t/yacc-misc.sh
@@ -35,7 +35,7 @@ END
 cat > parse.y << 'END'
 %{
 int yylex () { return 0; }
-void yyerror (char *s) {}
+void yyerror (const char *s) {}
 %}
 %%
 foobar : 'f' 'o' 'o' 'b' 'a' 'r' {};
@@ -45,7 +45,7 @@ END
 cat > bar.y << 'END'
 %{
 int yylex () { return 0; }
-void yyerror (char *s) {}
+void yyerror (const char *s) {}
 %}
 %%
 fubar : 'f' 'o' 'o' 'b' 'a' 'r' {};
diff --git a/t/yacc-mix-c-cxx.sh b/t/yacc-mix-c-cxx.sh
index ad9bf9523..45dffa0d2 100644
--- a/t/yacc-mix-c-cxx.sh
+++ b/t/yacc-mix-c-cxx.sh
@@ -53,7 +53,7 @@ END
 cat > p.y <<'END'
 %{
 int yylex (void) { int new = 0; return new; }
-void yyerror (char *s) { return; }
+void yyerror (const char *s) {}
 %}
 %token ZARDOZ
 %%
@@ -85,7 +85,7 @@ cat > parse.yy <<'END'
 #include <cstdlib>
 #include "parse.hh"
 int yylex (void) { return 0; }
-void yyerror (const char *s) { return; }
+void yyerror (const char *s) {}
 %}
 %token FOOBAR
 %%
@@ -97,7 +97,7 @@ cat > parse2.y++ <<'END'
 %{
 #include <cstdlib>
 int yylex (void) { return 0; }
-void yyerror (const char *s) { return; }
+void yyerror (const char *s) {}
 %}
 %%
 x : 'x' {};
diff --git a/t/yacc-nodist.sh b/t/yacc-nodist.sh
index 075e07743..3b523e888 100644
--- a/t/yacc-nodist.sh
+++ b/t/yacc-nodist.sh
@@ -59,7 +59,7 @@ parse.y:
 	:; { : \
 	  && echo "%{" \
 	  && echo "int yylex () { return 0; }" \
-	  && echo "void yyerror (char *s) {}" \
+	  && echo "void yyerror (const char *s) {}" \
 	  && echo "%}" \
 	  && echo "%%" \
 	  && echo "maude : 'm' 'a' 'u' 'd' 'e' {}"; \
diff --git a/t/yacc-pr204.sh b/t/yacc-pr204.sh
index 9606f7b3d..e07f5e5c9 100644
--- a/t/yacc-pr204.sh
+++ b/t/yacc-pr204.sh
@@ -51,7 +51,7 @@ EOF
 cat > parse.y << 'END'
 %{
 int yylex () {return 0;}
-void yyerror (char *s) {}
+void yyerror (const char *s) {}
 %}
 %%
 maude : 'm' 'a' 'u' 'd' 'e' {};
diff --git a/t/yacc-subdir.sh b/t/yacc-subdir.sh
index 5f3862187..879b433c6 100644
--- a/t/yacc-subdir.sh
+++ b/t/yacc-subdir.sh
@@ -49,7 +49,7 @@ mkdir foo
 cat > foo/parse.y << 'END'
 %{
 int yylex () { return 0; }
-void yyerror (char *s) {}
+void yyerror (const char *s) {}
 %}
 %%
 foobar : 'f' 'o' 'o' 'b' 'a' 'r' {};
diff --git a/t/yacc-vpath.sh b/t/yacc-vpath.sh
index f9bb719da..5481d9646 100644
--- a/t/yacc-vpath.sh
+++ b/t/yacc-vpath.sh
@@ -40,7 +40,7 @@ END
 cat > parse.y << 'END'
 %{
 int yylex () { return 0; }
-void yyerror (char *s) {}
+void yyerror (const char *s) {}
 %}
 %%
 foobar : 'f' 'o' 'o' 'b' 'a' 'r' {};
@@ -67,7 +67,7 @@ $sleep
 cat > ../parse.y << 'END'
 %{
 int yylex () { return 0; }
-void yyerror (char *s) {}
+void yyerror (const char *s) {}
 %}
 %%
 fubar : 'f' 'o' 'o' 'b' 'a' 'r' {};
@@ -85,7 +85,7 @@ $sleep
 cat > ../parse.y << 'END'
 %{
 int yylex () { return 0; }
-void yyerror (char *s) {}
+void yyerror (const char *s) {}
 %}
 %%
 maude : 'm' 'a' 'u' 'd' 'e' {};
diff --git a/t/yflags-cmdline-override.sh b/t/yflags-cmdline-override.sh
index eaee47849..63d31fbfa 100644
--- a/t/yflags-cmdline-override.sh
+++ b/t/yflags-cmdline-override.sh
@@ -43,7 +43,7 @@ END
 cat > foo.y << 'END'
 %{
 int yylex () { return 0; }
-void yyerror (char *s) { return; }
+void yyerror (const char *s) {}
 int main () { return 0; }
 %}
 %%
diff --git a/t/yflags-force-override.sh b/t/yflags-force-override.sh
index 2d5cb55e1..1346c1259 100644
--- a/t/yflags-force-override.sh
+++ b/t/yflags-force-override.sh
@@ -37,7 +37,7 @@ END
 cat > foo.y << 'END'
 %{
 int yylex () { return 0; }
-void yyerror (char *s) { return; }
+void yyerror (const char *s) {}
 int main () { return 0; }
 %}
 %%





Information forwarded to bug-automake <at> gnu.org:
bug#50469; Package automake. (Sat, 11 Sep 2021 11:04:01 GMT) Full text and rfc822 format available.

Message #38 received at 50469 <at> debbugs.gnu.org (full text, mbox):

From: Kiyoshi KANAZAWA <yoi_no_myoujou <at> yahoo.co.jp>
To: Akim Demaille <akim <at> lrde.epita.fr>, Sam James <sam <at> cmpct.info>
Cc: "50469 <at> debbugs.gnu.org" <50469 <at> debbugs.gnu.org>,
 Paul Eggert <eggert <at> cs.ucla.edu>, Bison Bugs <bug-bison <at> gnu.org>,
 Karl Berry <karl <at> freefriends.org>
Subject: Re: bug#50469: [bison-3.8] bug or side effect to flex & automake
Date: Sat, 11 Sep 2021 20:03:30 +0900 (JST)
Thank you, Akim.

I confirmed failures of automake's make check disappeared with your patch, except for original ones, suchi as
FAIL: t/lex-clean-cxx.sh
FAIL: t/lex-depend-cxx.sh

Tested with both of bison-3.8 & bison-3.8.1.

Failures of flex's make check also disappeared with bison-3.8.1.

Regards,

--- Kiyoshi





Information forwarded to bug-automake <at> gnu.org:
bug#50469; Package automake. (Sat, 11 Sep 2021 14:57:01 GMT) Full text and rfc822 format available.

Message #41 received at 50469 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Kiyoshi KANAZAWA <yoi_no_myoujou <at> yahoo.co.jp>,
 Akim Demaille <akim <at> lrde.epita.fr>, Sam James <sam <at> cmpct.info>
Cc: "50469 <at> debbugs.gnu.org" <50469 <at> debbugs.gnu.org>,
 Bison Bugs <bug-bison <at> gnu.org>, Karl Berry <karl <at> freefriends.org>
Subject: Re: bug#50469: [bison-3.8] bug or side effect to flex & automake
Date: Sat, 11 Sep 2021 07:56:28 -0700
On 9/11/21 4:03 AM, Kiyoshi KANAZAWA wrote:

> Failures of flex's make check also disappeared with bison-3.8.1.

Thanks for testing, and thanks Akim for writing the patch. I installed 
it on the automake master branch on Savannah.




Reply sent to Karl Berry <karl <at> freefriends.org>:
You have taken responsibility. (Sun, 19 Sep 2021 21:10:03 GMT) Full text and rfc822 format available.

Notification sent to Akim Demaille <akim <at> lrde.epita.fr>:
bug acknowledged by developer. (Sun, 19 Sep 2021 21:10:03 GMT) Full text and rfc822 format available.

Message #46 received at 50469-done <at> debbugs.gnu.org (full text, mbox):

From: Karl Berry <karl <at> freefriends.org>
To: 50469-done <at> debbugs.gnu.org
Date: Sun, 19 Sep 2021 15:08:58 -0600



bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 18 Oct 2021 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 213 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.