From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id 83F483865C2D for ; Tue, 1 Sep 2020 17:38:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 83F483865C2D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=joseph_myers@mentor.com IronPort-SDR: H+jWIAcVHuWVwa8kc1Dbq8TgM+d+RIKq+DTXbPpTnYRjLCoTctSml97WB1/wfnfgIw7mDy05u3 g1Fe1a9EM2zmFlan6ZFU6IuTXHnBXDWiBJLG6BbthsC6ksPhlPXVYOC8Oq9EClQxvbgP8ogAf1 YVJzaLWLSOIwXmYeYcBlUMW7fSxnPsLOF2Dt+QXFdTcHEoENn/WkWdQFJJPFqe8L/QSEo7vZvE fgvuwMDyZKYoFbQm+pwmb4q2+rrIyPmJBPzn//Jo45L6r2048QM91Mx8vBlEw3UWOoeZFK4ZbG fIY= X-IronPort-AV: E=Sophos;i="5.76,379,1592899200"; d="scan'208";a="54653284" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 01 Sep 2020 09:38:04 -0800 IronPort-SDR: dSVjmr7CZF5VdhOAOnz0+WSUYqA2MnVKC969hDcaQiUHq+VgoCamLTF5A+4zUyMCjhzDjYsht6 CpEUZBm4Y9iaAd99gaaEUfPfef1Z2i6IFWHUwSG/09qwCdNSAfODV29OwvHARV6gWBM7ktB+fT PXmbBOcvTHx9d0NU9Ol58GY8dVMiAiJUBLKmBqN6q6KLLnLzfvDaDifu30Z5y/i5p7CviV8XCv kvegfZpN1XIAfmpojRQjoKdu9ZOBQCj38DnD5ZNSqeqwrS3iF6hfa7UUpfiOtW4PIuahGj2Gxs 1ww= Date: Tue, 1 Sep 2020 17:37:59 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: "Maciej W. Rozycki" CC: Florian Weimer , Subject: Re: [PATCH] string: Fix GCC 11 `-Werror=stringop-overread' error In-Reply-To: Message-ID: References: <875z8znq8e.fsf@oldenburg2.str.redhat.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-03.mgc.mentorg.com (139.181.222.3) To SVR-IES-MBX-03.mgc.mentorg.com (139.181.222.3) X-Spam-Status: No, score=-3127.6 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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, 01 Sep 2020 17:38:06 -0000 On Mon, 31 Aug 2020, Maciej W. Rozycki via Libc-alpha wrote: > Umm, I never used this feature before and got confused with the version > mismatch (7 vs 8) right above: > > #if __GNUC_PREREQ (7, 0) > DIAG_IGNORE_NEEDS_COMMENT (8, "-Wstringop-overflow="); > #endif > > misleading me into thinking GCC 7 is the version that introduced the > `_Pragma' feature we use here. > > Joseph: has the mismatch been intentional? All GCC versions supported for building glibc support the relevant pragma. However, the pragma gives an error if the -W option named isn't supported in the GCC version being used, so __GNUC_PREREQ conditionals are needed around uses of the pragma with options not present in the minimum GCC version for building glibc (currently GCC 6). The version number in the macro call is ignored by the macro and is only for human readers. It indicates the *most recent* GCC version with which the warning has been observed, and is intended as a hint that a particular use of the pragma might be obsolete, if the version named is older than the oldest GCC version still supported for building glibc - but actually determining whether it is obsolete would require removing the pragma and trying building with that GCC version. That number is more relevant where the pragma is working around a GCC bug, and thus might well not be needed with newer GCC, than where the code (typically a testcase) is deliberately doing something that is deliberately warned about (which is common for tests of various corner cases) and thus the warning is not expected to disappear with newer GCC. -- Joseph S. Myers joseph@codesourcery.com