From unknown Mon Aug 18 09:02:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11829: Build failure with --enable-gcc-warnings Resent-From: Stefano Lattarini Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Sat, 30 Jun 2012 22:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 11829 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 11829@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.134109522317748 (code B ref -1); Sat, 30 Jun 2012 22:28:02 +0000 Received: (at submit) by debbugs.gnu.org; 30 Jun 2012 22:27:03 +0000 Received: from localhost ([127.0.0.1]:39582 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sl686-0004c2-BT for submit@debbugs.gnu.org; Sat, 30 Jun 2012 18:27:03 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53002) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sl683-0004bo-OX for submit@debbugs.gnu.org; Sat, 30 Jun 2012 18:27:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sl63k-0006E1-Oz for submit@debbugs.gnu.org; Sat, 30 Jun 2012 18:22:33 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:46421) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sl63k-0006Dx-J0 for submit@debbugs.gnu.org; Sat, 30 Jun 2012 18:22:32 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39769) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sl63i-0000ei-VF for bug-coreutils@gnu.org; Sat, 30 Jun 2012 18:22:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sl63h-0006DQ-4P for bug-coreutils@gnu.org; Sat, 30 Jun 2012 18:22:30 -0400 Received: from mail-we0-f169.google.com ([74.125.82.169]:57167) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sl63g-0006Cy-R8 for bug-coreutils@gnu.org; Sat, 30 Jun 2012 18:22:29 -0400 Received: by wefh52 with SMTP id h52so3567581wef.0 for ; Sat, 30 Jun 2012 15:22:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:mime-version:to:subject:content-type :content-transfer-encoding; bh=8h2V2gNNOcxdSHflQ39rZWS383VkytqhKGynUlkhG0s=; b=u6FAl6tScaDmeE1isTaIO1UJq/kC+j9DlD+mmORygTLBnzco8stSD7HRR7g923db5A IYFwfN++XUdrxNQ8XrqkMkDNMS9E56NvfuCDYWW6daVcRJCmWWOKFTWcjoJU5mg56sLG 1xlyYYCTDX9p1mbOMu3drxCLo3f6Iv2UQL0sNp7nv49wcLG1dw/oobhjgI4WtieVQddu lNsHekSp6u5qsP/uZCMKYqZ56cZ5ymX8OEKFYnUug0lGI4OSLtaCpF9aK6eLnagYOgc2 wMwgTkP6UPYtf6q0uLykxdRUG+UiqxB9AVL0l1sVu/GJb4MP/avOY4D99UZk9fGlOLTd SX8A== Received: by 10.216.218.200 with SMTP id k50mr3253036wep.212.1341094946412; Sat, 30 Jun 2012 15:22:26 -0700 (PDT) Received: from [87.2.92.179] (host179-92-dynamic.2-87-r.retail.telecomitalia.it. [87.2.92.179]) by mx.google.com with ESMTPS id fb20sm5924590wid.1.2012.06.30.15.22.24 (version=SSLv3 cipher=OTHER); Sat, 30 Jun 2012 15:22:25 -0700 (PDT) Message-ID: <4FEF7C1E.7040508@gmail.com> Date: Sun, 01 Jul 2012 00:22:22 +0200 From: Stefano Lattarini MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.1 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) Trying to build the latest coreutils from master: $ make all ... CC stty.o stty.c: In function 'main': stty.c:740:8: error: variable 'speed_was_set' set but not used [-Werror=unused-but-set-variable] cc1: all warnings being treated as errors make[3]: *** [stty.o] Error 1 $ uname -rmos Linux 3.3.1-3.fc16.ppc64 ppc64 GNU/Linux $ gcc --version gcc (GCC) 4.6.3 20120306 (Red Hat 4.6.3-2) Copyright (C) 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Let me know if you need more information. Regards, Stefano From unknown Mon Aug 18 09:02:31 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.428 (Entity 5.428) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Stefano Lattarini Subject: bug#11829: closed (Re: bug#11829: Build failure with --enable-gcc-warnings) Message-ID: References: <4FEF8771.2020308@draigBrady.com> <4FEF7C1E.7040508@gmail.com> X-Gnu-PR-Message: they-closed 11829 X-Gnu-PR-Package: coreutils Reply-To: 11829@debbugs.gnu.org Date: Sat, 30 Jun 2012 23:16:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1341098162-21958-1" This is a multi-part message in MIME format... ------------=_1341098162-21958-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #11829: Build failure with --enable-gcc-warnings which was filed against the coreutils package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 11829@debbugs.gnu.org. --=20 11829: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D11829 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1341098162-21958-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 11829-done) by debbugs.gnu.org; 30 Jun 2012 23:15:24 +0000 Received: from localhost ([127.0.0.1]:39607 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sl6sq-0005hF-9X for submit@debbugs.gnu.org; Sat, 30 Jun 2012 19:15:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20393) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sl6sn-0005h7-8M for 11829-done@debbugs.gnu.org; Sat, 30 Jun 2012 19:15:18 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q5UNAo8o016039 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 30 Jun 2012 19:10:50 -0400 Received: from [10.3.113.39] (ovpn-113-39.phx2.redhat.com [10.3.113.39]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q5UNAlBZ015713 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 30 Jun 2012 19:10:49 -0400 Message-ID: <4FEF8771.2020308@draigBrady.com> Date: Sun, 01 Jul 2012 00:10:41 +0100 From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20110816 Thunderbird/6.0 MIME-Version: 1.0 To: Stefano Lattarini Subject: Re: bug#11829: Build failure with --enable-gcc-warnings References: <4FEF7C1E.7040508@gmail.com> In-Reply-To: <4FEF7C1E.7040508@gmail.com> X-Enigmail-Version: 1.3.2 Content-Type: text/plain; charset=UTF-8 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id q5UNAo8o016039 X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: 11829-done Cc: 11829-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) On 06/30/2012 11:22 PM, Stefano Lattarini wrote: > Trying to build the latest coreutils from master: >=20 > $ make all > ... > CC stty.o > stty.c: In function 'main': > stty.c:740:8: error: variable 'speed_was_set' set but not used [-Werr= or=3Dunused-but-set-variable] > cc1: all warnings being treated as errors > make[3]: *** [stty.o] Error 1 >=20 > $ uname -rmos > Linux 3.3.1-3.fc16.ppc64 ppc64 GNU/Linux >=20 > $ gcc --version > gcc (GCC) 4.6.3 20120306 (Red Hat 4.6.3-2) > Copyright (C) 2011 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There = is NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PU= RPOSE. >=20 > Let me know if you need more information. This should address it: commit 8f4dcad477da1a952a04478ae125d5453f29dcc9 Author: P=C3=A1draig Brady Date: Sun Jul 1 00:04:37 2012 +0100 maint: avoid a -Wunsed-but-set warning on some systems * src/stty.c (main): Mark speed_was_set as unused when CIBAUD undefined (like on ppc64 GNU/Linux for example). Reported-by: Stefano Lattarini diff --git a/src/stty.c b/src/stty.c index 83b502c..b2dd849 100644 --- a/src/stty.c +++ b/src/stty.c @@ -737,7 +737,11 @@ main (int argc, char **argv) int argi =3D 0; int opti =3D 1; bool require_set_attr; +#ifdef CIBAUD bool speed_was_set; +#else + bool speed_was_set ATTRIBUTE_UNUSED; +#endif bool verbose_output; bool recoverable_output; int k; ------------=_1341098162-21958-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 30 Jun 2012 22:27:03 +0000 Received: from localhost ([127.0.0.1]:39582 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sl686-0004c2-BT for submit@debbugs.gnu.org; Sat, 30 Jun 2012 18:27:03 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53002) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sl683-0004bo-OX for submit@debbugs.gnu.org; Sat, 30 Jun 2012 18:27:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sl63k-0006E1-Oz for submit@debbugs.gnu.org; Sat, 30 Jun 2012 18:22:33 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:46421) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sl63k-0006Dx-J0 for submit@debbugs.gnu.org; Sat, 30 Jun 2012 18:22:32 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39769) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sl63i-0000ei-VF for bug-coreutils@gnu.org; Sat, 30 Jun 2012 18:22:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sl63h-0006DQ-4P for bug-coreutils@gnu.org; Sat, 30 Jun 2012 18:22:30 -0400 Received: from mail-we0-f169.google.com ([74.125.82.169]:57167) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sl63g-0006Cy-R8 for bug-coreutils@gnu.org; Sat, 30 Jun 2012 18:22:29 -0400 Received: by wefh52 with SMTP id h52so3567581wef.0 for ; Sat, 30 Jun 2012 15:22:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:mime-version:to:subject:content-type :content-transfer-encoding; bh=8h2V2gNNOcxdSHflQ39rZWS383VkytqhKGynUlkhG0s=; b=u6FAl6tScaDmeE1isTaIO1UJq/kC+j9DlD+mmORygTLBnzco8stSD7HRR7g923db5A IYFwfN++XUdrxNQ8XrqkMkDNMS9E56NvfuCDYWW6daVcRJCmWWOKFTWcjoJU5mg56sLG 1xlyYYCTDX9p1mbOMu3drxCLo3f6Iv2UQL0sNp7nv49wcLG1dw/oobhjgI4WtieVQddu lNsHekSp6u5qsP/uZCMKYqZ56cZ5ymX8OEKFYnUug0lGI4OSLtaCpF9aK6eLnagYOgc2 wMwgTkP6UPYtf6q0uLykxdRUG+UiqxB9AVL0l1sVu/GJb4MP/avOY4D99UZk9fGlOLTd SX8A== Received: by 10.216.218.200 with SMTP id k50mr3253036wep.212.1341094946412; Sat, 30 Jun 2012 15:22:26 -0700 (PDT) Received: from [87.2.92.179] (host179-92-dynamic.2-87-r.retail.telecomitalia.it. [87.2.92.179]) by mx.google.com with ESMTPS id fb20sm5924590wid.1.2012.06.30.15.22.24 (version=SSLv3 cipher=OTHER); Sat, 30 Jun 2012 15:22:25 -0700 (PDT) Message-ID: <4FEF7C1E.7040508@gmail.com> Date: Sun, 01 Jul 2012 00:22:22 +0200 From: Stefano Lattarini MIME-Version: 1.0 To: bug-coreutils@gnu.org Subject: Build failure with --enable-gcc-warnings Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.1 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) Trying to build the latest coreutils from master: $ make all ... CC stty.o stty.c: In function 'main': stty.c:740:8: error: variable 'speed_was_set' set but not used [-Werror=unused-but-set-variable] cc1: all warnings being treated as errors make[3]: *** [stty.o] Error 1 $ uname -rmos Linux 3.3.1-3.fc16.ppc64 ppc64 GNU/Linux $ gcc --version gcc (GCC) 4.6.3 20120306 (Red Hat 4.6.3-2) Copyright (C) 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Let me know if you need more information. Regards, Stefano ------------=_1341098162-21958-1-- From unknown Mon Aug 18 09:02:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11829: Build failure with --enable-gcc-warnings Resent-From: Eric Blake Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Sat, 30 Jun 2012 23:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11829 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 11829@debbugs.gnu.org, P@draigBrady.com Received: via spool by 11829-submit@debbugs.gnu.org id=B11829.134109976524202 (code B ref 11829); Sat, 30 Jun 2012 23:43:02 +0000 Received: (at 11829) by debbugs.gnu.org; 30 Jun 2012 23:42:45 +0000 Received: from localhost ([127.0.0.1]:39626 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sl7JM-0006II-TR for submit@debbugs.gnu.org; Sat, 30 Jun 2012 19:42:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28769) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sl7JJ-0006I3-6Q for 11829@debbugs.gnu.org; Sat, 30 Jun 2012 19:42:43 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q5UNcEBC021663 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 30 Jun 2012 19:38:14 -0400 Received: from [10.3.113.10] ([10.3.113.10]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q5UNcDHd009553; Sat, 30 Jun 2012 19:38:13 -0400 Message-ID: <4FEF8DE4.7060400@redhat.com> Date: Sat, 30 Jun 2012 17:38:12 -0600 From: Eric Blake Organization: Red Hat User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 MIME-Version: 1.0 References: <4FEF7C1E.7040508@gmail.com> <4FEF8771.2020308@draigBrady.com> In-Reply-To: <4FEF8771.2020308@draigBrady.com> X-Enigmail-Version: 1.4.2 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigAD0A6DC3ED3A178D5D3787D2" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Spam-Score: -6.9 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigAD0A6DC3ED3A178D5D3787D2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 06/30/2012 05:10 PM, P=C3=A1draig Brady wrote: > This should address it: >=20 > commit 8f4dcad477da1a952a04478ae125d5453f29dcc9 > Author: P=C3=A1draig Brady > Date: Sun Jul 1 00:04:37 2012 +0100 >=20 > maint: avoid a -Wunsed-but-set warning on some systems >=20 > * src/stty.c (main): Mark speed_was_set as unused when > CIBAUD undefined (like on ppc64 GNU/Linux for example). > Reported-by: Stefano Lattarini >=20 > diff --git a/src/stty.c b/src/stty.c > index 83b502c..b2dd849 100644 > --- a/src/stty.c > +++ b/src/stty.c > @@ -737,7 +737,11 @@ main (int argc, char **argv) > int argi =3D 0; > int opti =3D 1; > bool require_set_attr; > +#ifdef CIBAUD > bool speed_was_set; > +#else > + bool speed_was_set ATTRIBUTE_UNUSED; > +#endif Three lines too many. ATTRIBUTE_UNUSED is defined by gcc to mean 'might be unused, therefore don't warn if it was not used', and not 'must not be used, and therefore warn if it is used'. Therefore, it is always safe to use the one-liner: bool speed_was_set ATTRIBUTE_UNUSED; even if, when CIBAUD is defined, it was actually used. No need for extra #ifdef. --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enigAD0A6DC3ED3A178D5D3787D2 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJP743kAAoJEKeha0olJ0Nq2WEH/jSDTsksywJLKF9h3IRtYemG AamwRv3pUL0ENYkMNzhouMesqPzOxJ7I7Uk3Km5tFcQ1v6eMI0yxDLPa7N1Lrypb Js1yqC85JlsMq5ROuT1MSYONv018GKdaFLjt5Yq60eSVU03x7AaTj4wKlzzMglc9 6KB7nvMGGvC+MaNpw1owWrt6ckOXzFekZV+v91YqNtXOBX0dZPtFfCtmGnxb1pOd /KclfUd/I3KPck05ntuM1TJBfr57M5XfaSVBnCpXiQle+bqlnGSKh3KAjjlSWiu0 VNMGDVkB2amWCop8zR5idiwym/KW3fX18Je29mZwGNHFaizFfkyVZd0kc1v2M7Y= =cPMB -----END PGP SIGNATURE----- --------------enigAD0A6DC3ED3A178D5D3787D2-- From unknown Mon Aug 18 09:02:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11829: Build failure with --enable-gcc-warnings Resent-From: =?UTF-8?Q?P=C3=A1draig?= Brady Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Sat, 30 Jun 2012 23:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11829 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Eric Blake Cc: 11829@debbugs.gnu.org Received: via spool by 11829-submit@debbugs.gnu.org id=B11829.134110031124996 (code B ref 11829); Sat, 30 Jun 2012 23:52:01 +0000 Received: (at 11829) by debbugs.gnu.org; 30 Jun 2012 23:51:51 +0000 Received: from localhost ([127.0.0.1]:39645 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sl7S8-0006V4-1O for submit@debbugs.gnu.org; Sat, 30 Jun 2012 19:51:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29678) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sl7S5-0006Uw-Es for 11829@debbugs.gnu.org; Sat, 30 Jun 2012 19:51:46 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q5UNlJBL008064 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for <11829@debbugs.gnu.org>; Sat, 30 Jun 2012 19:47:19 -0400 Received: from [10.3.113.39] (ovpn-113-39.phx2.redhat.com [10.3.113.39]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q5UNlGFZ006568 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 30 Jun 2012 19:47:18 -0400 Message-ID: <4FEF8FF6.6080901@draigBrady.com> Date: Sun, 01 Jul 2012 00:47:02 +0100 From: =?UTF-8?Q?P=C3=A1draig?= Brady User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20110816 Thunderbird/6.0 MIME-Version: 1.0 References: <4FEF7C1E.7040508@gmail.com> <4FEF8771.2020308@draigBrady.com> <4FEF8DE4.7060400@redhat.com> In-Reply-To: <4FEF8DE4.7060400@redhat.com> X-Enigmail-Version: 1.3.2 Content-Type: text/plain; charset=UTF-8 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id q5UNlJBL008064 X-Spam-Score: -6.9 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) On 07/01/2012 12:38 AM, Eric Blake wrote: > On 06/30/2012 05:10 PM, P=C3=A1draig Brady wrote: >=20 >> This should address it: >> >> commit 8f4dcad477da1a952a04478ae125d5453f29dcc9 >> Author: P=C3=A1draig Brady >> Date: Sun Jul 1 00:04:37 2012 +0100 >> >> maint: avoid a -Wunsed-but-set warning on some systems >> >> * src/stty.c (main): Mark speed_was_set as unused when >> CIBAUD undefined (like on ppc64 GNU/Linux for example). >> Reported-by: Stefano Lattarini >> >> diff --git a/src/stty.c b/src/stty.c >> index 83b502c..b2dd849 100644 >> --- a/src/stty.c >> +++ b/src/stty.c >> @@ -737,7 +737,11 @@ main (int argc, char **argv) >> int argi =3D 0; >> int opti =3D 1; >> bool require_set_attr; >> +#ifdef CIBAUD >> bool speed_was_set; >> +#else >> + bool speed_was_set ATTRIBUTE_UNUSED; >> +#endif >=20 > Three lines too many. ATTRIBUTE_UNUSED is defined by gcc to mean 'migh= t > be unused, therefore don't warn if it was not used', and not 'must not > be used, and therefore warn if it is used'. Therefore, it is always > safe to use the one-liner: >=20 > bool speed_was_set ATTRIBUTE_UNUSED; >=20 > even if, when CIBAUD is defined, it was actually used. No need for > extra #ifdef. >=20 But then you would never get such warnings for this variable. I was trying to disable the warning only where it's incorrect, and thought the single ifdef worth it? From unknown Mon Aug 18 09:02:31 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11829: Build failure with --enable-gcc-warnings Resent-From: Eric Blake Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Sat, 30 Jun 2012 23:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11829 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: =?UTF-8?Q?P=C3=A1draig?= Brady Cc: 11829@debbugs.gnu.org Received: via spool by 11829-submit@debbugs.gnu.org id=B11829.134110070225536 (code B ref 11829); Sat, 30 Jun 2012 23:59:02 +0000 Received: (at 11829) by debbugs.gnu.org; 30 Jun 2012 23:58:22 +0000 Received: from localhost ([127.0.0.1]:39652 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sl7YU-0006do-ES for submit@debbugs.gnu.org; Sat, 30 Jun 2012 19:58:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23571) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sl7YR-0006dg-Ak for 11829@debbugs.gnu.org; Sat, 30 Jun 2012 19:58:20 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q5UNrqbS008416 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 30 Jun 2012 19:53:52 -0400 Received: from [10.3.113.10] ([10.3.113.10]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q5UNrpaA010330; Sat, 30 Jun 2012 19:53:51 -0400 Message-ID: <4FEF918F.8050409@redhat.com> Date: Sat, 30 Jun 2012 17:53:51 -0600 From: Eric Blake Organization: Red Hat User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 MIME-Version: 1.0 References: <4FEF7C1E.7040508@gmail.com> <4FEF8771.2020308@draigBrady.com> <4FEF8DE4.7060400@redhat.com> <4FEF8FF6.6080901@draigBrady.com> In-Reply-To: <4FEF8FF6.6080901@draigBrady.com> X-Enigmail-Version: 1.4.2 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig6B0DB216AD293BA0575C61BD" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Spam-Score: -6.9 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig6B0DB216AD293BA0575C61BD Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 06/30/2012 05:47 PM, P=C3=A1draig Brady wrote: >>> +#ifdef CIBAUD >>> bool speed_was_set; >>> +#else >>> + bool speed_was_set ATTRIBUTE_UNUSED; >>> +#endif >> >> Three lines too many. ATTRIBUTE_UNUSED is defined by gcc to mean 'mig= ht >> be unused, therefore don't warn if it was not used', and not 'must not= >> be used, and therefore warn if it is used'. Therefore, it is always >> safe to use the one-liner: >> >> bool speed_was_set ATTRIBUTE_UNUSED; >> >> even if, when CIBAUD is defined, it was actually used. No need for >> extra #ifdef. >> >=20 > But then you would never get such warnings for this variable. > I was trying to disable the warning only where it's incorrect, > and thought the single ifdef worth it? My point is that there ARE no warnings if you unconditionally use the label. That is, gcc behaves the same with no warnings, on both the case where CIBAUD is undefined and where it is defined, given either: #ifdef CIBAUD bool speed_was_set; #else bool speed_was_set ATTRIBUTE_UNUSED; #endif =2E.. #ifdef CIBAUD use(speed_was_set); #endif or whether you use the shorter: bool speed_was_set ATTRIBUTE_UNUSED; =2E.. #ifdef CIBAUD use(speed_was_set); #endif and that's because the definition of ATTRIBUTE_UNUSED in gcc means only "this _might_ be unused on some conditional compilations, so suppress unused warnings". Had gcc defined ATTRIBUTE_UNUSED as "warn if we used it after all", then yes, you'd need the #ifdef. Thankfully, gcc did not use that formulation= =2E --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig6B0DB216AD293BA0575C61BD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJP75GPAAoJEKeha0olJ0Nqe10H/2BRKEVWQ3Dupo2NWItkCH2e bIuo6IQ6DneJCOusmOSgNrgA71jWhoyavRNaeN9em1rhmfzfWSDiMT9f71Hww95v pUkxIIsyYLScGN621mKhxKcjlfQo3Nrpsc+aySYQ9zd89pPvRnrwfxcWTGYdSEF/ BY9OjZZDPRTPFciTFVGqluahfXWTRWUhP57RY1bCMY+WtrEWsLSj7YcJGF0QGEYr mdrFU4hIyZy4jUC+r0SyuRVGze5ySoA+Oc+BVmFhytS60bPHK8NKxIVIbrDDlJff qks48kuJUU00w7208l5BBk5YWUVvBLtA5lH4WXnBzF8NZ7RKDB7cMTa3mfINM4k= =QU71 -----END PGP SIGNATURE----- --------------enig6B0DB216AD293BA0575C61BD--