From patchwork Sun Dec 12 09:24:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Monaco X-Patchwork-Id: 48843 X-Patchwork-Delegate: arjun.is@lostca.se Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7178E385841C for ; Sun, 12 Dec 2021 09:24:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7178E385841C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1639301094; bh=Epr3Z7HOptJy/WDkvwu6bdgIyJq0rv8NdYub8grRtb0=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=JLlX/KFv7TFeTBw4sShr//NL5HypAMfNpyitoZSdhMDpwSrW/S7GvhmdFkcKt4i0g P7XTMwNejXlmMsn1g50uWDeEiNJWWY4CM3RbujqnATyt9d+W5P06GQCrZffbREGdQN 0T9i1CoZ0ApLstg363c4T3uvF6zmKCAatiGYhRl4= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from devianza.investici.org (devianza.investici.org [198.167.222.108]) by sourceware.org (Postfix) with ESMTPS id 88F91385840C for ; Sun, 12 Dec 2021 09:24:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 88F91385840C Received: from mx2.investici.org (unknown [127.0.0.1]) by devianza.investici.org (Postfix) with ESMTP id 4JBfNZ1vw4z6vH5 for ; Sun, 12 Dec 2021 09:24:30 +0000 (UTC) Received: from [198.167.222.108] (mx2.investici.org [198.167.222.108]) (Authenticated sender: andrea.monaco@autistici.org) by localhost (Postfix) with ESMTPSA id 4JBfNZ0Mnwz6vGx for ; Sun, 12 Dec 2021 09:24:29 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH] intl/plural.y: define macros to avoid multiple conflicting declarations of yyerror and yylex Date: Sun, 12 Dec 2021 10:24:28 +0100 Message-ID: <87zgp6mb03.fsf@autistici.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Andrea Monaco via Libc-alpha From: Andrea Monaco Reply-To: Andrea Monaco Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Hello. 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. Andrea Monaco 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}