public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Arjun Shankar <arjun@redhat.com>
To: Andrea Monaco <andrea.monaco@autistici.org>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH] intl/plural.y: define macros to avoid multiple conflicting declarations of yyerror and yylex
Date: Tue, 21 Dec 2021 23:49:03 +0100	[thread overview]
Message-ID: <CAG_osabqDQ4PQxTjDQ76Lx+rr6-RnX4ZmjQLSGiYQ230wjWCHw@mail.gmail.com> (raw)
In-Reply-To: <87zgp6mb03.fsf@autistici.org>

Hi Andrea,

> My glibc 2.34 failed building on GNU/Hurd, though the problem may be
> independent of the platform.
>
> That's the error in intl/plural.y:
>
> /root/glibc-2.34/build/intl/plural.c:69:25: error: static declaration of '__gettextlex' follows non-static declaration
>    69 | #define yylex           __gettextlex
>       |                         ^~~~~~~~~~~~
> plural.y:57:12: note: in expansion of macro 'yylex'
>    57 | static int yylex (YYSTYPE *lval, struct parse_args *arg);
>       |            ^~~~~
> /root/glibc-2.34/build/intl/plural.c:203:5: note: previous declaration of '__gettextlex' was here
>   203 | int __gettextlex (YYSTYPE *yylvalp, struct parse_args *arg);
>       |     ^~~~~~~~~~~~
> /root/glibc-2.34/build/intl/plural.c:70:25: error: static declaration of '__gettexterror' follows non-static declaration
>    70 | #define yyerror         __gettexterror
>       |                         ^~~~~~~~~~~~~~
> plural.y:58:13: note: in expansion of macro 'yyerror'
>    58 | static void yyerror (struct parse_args *arg, const char *str);
>       |             ^~~~~~~
> /root/glibc-2.34/build/intl/plural.c:200:6: note: previous declaration of '__gettexterror' was here
>   200 | void __gettexterror (struct parse_args *arg, const char *msg);
>       |      ^~~~~~~~~~~~~~
>
>
>
> The reason are these line in the generated build/intl/plural.c:
>
>   #if !defined __gettexterror && !defined YYERROR_IS_DECLARED
>   void __gettexterror (struct parse_args *arg, const char *msg);
>   #endif
>   #if !defined __gettextlex && !defined YYLEX_IS_DECLARED
>   int __gettextlex (YYSTYPE *yylvalp, struct parse_args *arg);
>   #endif
>
> Those default prototypes provided by bison trigger a conflict between
> multiple declarations.  This patch solves the issue.  Thanks.

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.

May I know which version of bison you're using? Or am I missing
something else here? I'm using Fedora but I expect that, like you
mentioned already and unless I'm mistaken, this shouldn't matter.

Thanks!
Arjun


  reply	other threads:[~2021-12-21 22:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-12  9:24 Andrea Monaco
2021-12-21 22:49 ` Arjun Shankar [this message]
2021-12-21 23:54 Andrea Monaco
2021-12-22 13:45 ` Arjun Shankar
2021-12-22 15:07   ` Arjun Shankar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAG_osabqDQ4PQxTjDQ76Lx+rr6-RnX4ZmjQLSGiYQ230wjWCHw@mail.gmail.com \
    --to=arjun@redhat.com \
    --cc=andrea.monaco@autistici.org \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).