From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 4D6BF3858C31 for ; Mon, 15 May 2023 12:28:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4D6BF3858C31 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B16592F4; Mon, 15 May 2023 05:29:41 -0700 (PDT) Received: from [10.2.78.54] (e120077-lin.cambridge.arm.com [10.2.78.54]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1D5FF3F663; Mon, 15 May 2023 05:28:56 -0700 (PDT) Message-ID: <6537c979-1c1a-9266-b372-7d2ebbf50438@arm.com> Date: Mon, 15 May 2023 13:28:41 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: More C type errors by default for GCC 14 To: Eli Zaretskii , =?UTF-8?Q?Arsen_Arsenovi=c4=87?= Cc: dje.gcc@gmail.com, jakub@redhat.com, jwakely.gcc@gmail.com, gcc@gcc.gnu.org References: <877cth66qb.fsf@oldenburg.str.redhat.com> <20230509102201.6aa2a7d14fdb2f1e7abff449@killthe.net> <87r0rp5uf8.fsf@aarsen.me> <83ttwla1ep.fsf@gnu.org> <83lehx9vix.fsf@gnu.org> <83fs859unu.fsf@gnu.org> <864jolw8id.fsf@aarsen.me> <83cz38ap1a.fsf@gnu.org> Content-Language: en-GB From: "Richard Earnshaw (lists)" In-Reply-To: <83cz38ap1a.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3494.7 required=5.0 tests=BAYES_00,KAM_DMARC_NONE,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,KAM_NUMSUBJECT,NICE_REPLY_A,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 10/05/2023 03:38, Eli Zaretskii via Gcc wrote: >> From: Arsen Arsenović >> Cc: Eli Zaretskii , Jakub Jelinek , >> jwakely.gcc@gmail.com, gcc@gcc.gnu.org >> Date: Tue, 09 May 2023 22:21:03 +0200 >> >>> The concern is using the good will of the GNU Toolchain brand as the tip of >>> the spear or battering ram to motivate software packages to fix their >>> problems. It's using GCC as leverage in a manner that is difficult for >>> package maintainers to avoid. Maybe that's a necessary approach, but we >>> should be clear about the reasoning. Again, I'm not objecting, but let's >>> clarify why we are choosing this approach. >> >> Both the GNU Toolchain and the GNU Toolchain users will benefit from a >> stricter toolchain. >> >> People can and have stopped using the GNU Toolchain due to lackluster >> and non-strict defaults. This is certainly not positive for the brand, >> and I doubt it buys it much good will. > > It is not GCC's business to force developers of packages to get their > act together. It is the business of those package developers > themselves. GCC should give those developers effective and convenient > means of detecting any unsafe and dubious code and of correcting it as > they see fit. Which GCC already does by emitting warnings. GCC > should only error out if it is completely unable to produce valid > code, which is not the case here, since it has been producing valid > code for ages. > > It is a disservice to GCC users if a program that compiled yesterday > and worked perfectly well suddenly cannot be built because GCC was > upgraded, perhaps due to completely unrelated reasons. It would be a > grave mistake on the part of GCC to decide that part of its mission is > to teach package developers how to write their code and when and how > to modify it. That argument doesn't really wash. We already upgrade the 'default' language version (-std=...) from time to time and that can impact existing programs (eg we changed from gnu-inline to std-inline model). If this really isn't legal C, then my suggestion would be to tie this to a setting of -std, so -std=c2 would default to being more aggressive in enforcing this (via changing the warning to -werror=) and then -std=gnu2 might follow a bit behind that. Furthermore, we can trail this aggressively in release notes so that nobody can really claim to be surprised. At some point that std setting will become the default and the overall goal is achieved. R.