[PATCH] intl/plural.y: define macros to avoid multiple conflicting declarations of yyerror and yylex

Arjun Shankar arjun@redhat.com
Wed Dec 22 13:45:07 GMT 2021


Hi Andrea,

>   > I'm trying to reproduce this and have been unable to see these lines
>   > generated with bison-3.6.4, 3.7.6, and 3.8.2.
>
>
> Mine is gnu bison 3.8.  I got the same problem in binutils
> (https://lists.gnu.org/archive/html/bug-binutils/2021-11/msg00057.html)
> and it was replicated by a person, though we fixed it in a different way.

Thanks. I was able to reproduce it with bison-3.8. It looks like it
was a transient issue that occurred in bison-3.8 and was fixed by
bison-3.8.2.

This patch lets glibc successfully build with bison-3.8 installed and
is therefore useful.

diff --git a/intl/plural.y b/intl/plural.y
index e02e74541c..8573b56563 100644
--- a/intl/plural.y
+++ b/intl/plural.y
@@ -40,6 +40,11 @@
 # define __gettextparse PLURAL_PARSE
 #endif

+/* Later we provide those prototypes. Without these macros, bison may
+   generate its own prototypes with possible conflicts */
+#define YYLEX_IS_DECLARED
+#define YYERROR_IS_DECLARED
+
 %}
 %parse-param {struct parse_args *arg}
 %lex-param {struct parse_args *arg}

OK. glibc uses double spaces at the end of a sentence in comments.
It's a minor edit and I'll make it before committing.

Reviewed-by: Arjun Shankar <arjun@redhat.com>



More information about the Libc-alpha mailing list