From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 8A48D3858C60 for ; Tue, 21 Dec 2021 22:49:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8A48D3858C60 Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-479-H9jJ4h6EPySyuqx0q5S_dg-1; Tue, 21 Dec 2021 17:49:16 -0500 X-MC-Unique: H9jJ4h6EPySyuqx0q5S_dg-1 Received: by mail-ed1-f72.google.com with SMTP id h7-20020a05640250c700b003f800db4193so224359edb.1 for ; Tue, 21 Dec 2021 14:49:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EtzCFuo3ed/Ox4Mhu/ghRijtPh2Yrff3knYdlnjRsTY=; b=WpzxNKnpAbet1+As/ww+mHEzin1mw81qYuB1FobbEiy+7Gxvc7Q6yKLETymco1mafP /5Cv5lxNZ3lnzVaTojUQtaw7Pikcgbk69sjn/xlP8X0KBBpXCWpwq+kITULQ9oQZ/w4p NWmFuc+ZNoTnWQXXN1yHx7CeSP8y8cWnram8GyZkhJJwB/7pN4ZB8Qn3bWfMSm0tvywo S6aYieODwjaUmMEVFoMnWXsKQdWJ7nZKvnFSkceoVoJlqRYDIFORoaJ2Q9yQptUrs9zp fO86AOJH9yuQWMfS7nFfJzLGqjPW+Bq2wd6nh61qUmvsQRkA1BIbyZbGovS9Veg9Cc1T FlnQ== X-Gm-Message-State: AOAM532vQy/3RlIgj1JP/rwzrllw4RPvAO/fP9qdzWPzsNeK+jx5eqrt 3W/5jleYyFeKK6cqIoTP86IpcaSUGt7fupZ8g7zh0oQ33VNMfZc7G/QpawDIVHynE3qc4uQkpRc ufCt+9sGBfBtqf3NpFTRnDIYTOOgDNmdQv9zz X-Received: by 2002:a17:906:d554:: with SMTP id cr20mr354528ejc.356.1640126954777; Tue, 21 Dec 2021 14:49:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJxBz/pNEzVnaz3RYab2oujgxHa5tahEsgK+4YwDXPm1GaWxgDVYA3UrpQhYU+0Ex1k6IHdiLqeCyGLFVDyD9A0= X-Received: by 2002:a17:906:d554:: with SMTP id cr20mr354518ejc.356.1640126954581; Tue, 21 Dec 2021 14:49:14 -0800 (PST) MIME-Version: 1.0 References: <87zgp6mb03.fsf@autistici.org> In-Reply-To: <87zgp6mb03.fsf@autistici.org> From: Arjun Shankar Date: Tue, 21 Dec 2021 23:49:03 +0100 Message-ID: Subject: Re: [PATCH] intl/plural.y: define macros to avoid multiple conflicting declarations of yyerror and yylex To: Andrea Monaco Cc: libc-alpha@sourceware.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, 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-List-Received-Date: Tue, 21 Dec 2021 22:49:18 -0000 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