From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from fencepost.gnu.org (fencepost.gnu.org [IPv6:2001:470:142:3::e]) by sourceware.org (Postfix) with ESMTPS id 5E1883858D20 for ; Wed, 10 May 2023 16:30:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5E1883858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=yd/sRS6ktivLxUsSYQ3k7IcVvHQ5tPs0SNvAyRlawXY=; b=T7NzzyYd+uWO ddyyk5TbZw1QkCCzyFCnXgsliv3+/lOfNIUQVFA4xGz1UPCcr3pyJoagX/nblQspYmr4r6jGLrWp0 o71C/PGl+qW0Fm2VVWxdNlEzcTmW+MSmUCRjTEyti5z2ehy7I6OtWC3U3LNKG3k18ExLCiMav3V3v LrdpQxJ7RWEYyBq2+qn5nSGoG9YkwKnXxx9n2yS4UcTyvqY8WR8H5ezNNBbAat9C/X6Y1KkenpYdu zoEciuYkmco2GjGN6c7deM52b/qmwZuODGtrJL44Djs1j1EBlQvgAzhbTgzLJjkr/qtIkD737XSl2 p91Ms1RiuqPyLoIz974hnA==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pwmi4-0002rA-8f; Wed, 10 May 2023 12:30:38 -0400 Date: Wed, 10 May 2023 19:31:42 +0300 Message-Id: <83mt2c6tch.fsf@gnu.org> From: Eli Zaretskii To: Jakub Jelinek Cc: gabravier@gmail.com, jwakely.gcc@gmail.com, fweimer@redhat.com, gcc@gcc.gnu.org, arsen@aarsen.me In-Reply-To: (message from Jakub Jelinek on Wed, 10 May 2023 18:02:53 +0200) Subject: Re: More C type errors by default for GCC 14 References: <87y1lx1avj.fsf@oldenburg.str.redhat.com> <83ednoapb6.fsf@gnu.org> <831qjoa0g0.fsf@gnu.org> <83o7ms8is7.fsf@gnu.org> <2ffbf210-1b58-737b-888c-4f84c5cc5e0f@gmail.com> <837ctg8e98.fsf@gnu.org> <83wn1g6w67.fsf@gnu.org> X-Spam-Status: No, score=2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_NUMSUBJECT,RCVD_IN_BARRACUDACENTRAL,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > Date: Wed, 10 May 2023 18:02:53 +0200 > From: Jakub Jelinek > Cc: gabravier@gmail.com, jwakely.gcc@gmail.com, fweimer@redhat.com, > gcc@gcc.gnu.org, arsen@aarsen.me > > > If some program is plainly invalid, not just because the criteria of > > validity have shifted, then yes, such a program should be rejected. > > Many of the accepts-invalid cases are when something used to be valid in some > older standard and is not valid in a newer standard, often even changes > meaning completely in even newer standard. > Examples include e.g. the auto keyword, which means something completely > different in C++11 and later than what it meant in C++98, or say comma in > array reference in C++17 vs. C++20 vs. C++23 (a[1, 2] is the same as a[(1, 2)] > in C++17, got deprecated in C++20 and is ill-formed or changed meaning > in C++23 (multi-dimensional array operator). > Or any time something that wasn't a keyword in older standard version > and is a keyword in a newer standard. > alignas/alignof/nullptr/static_assert/thread_local in C++11 and C23, > char16_t/char32_t/constexpr/decltype/noexcept in C++11, > constinit/consteval in C++20, > bool/false/true/typeof_unqual in C23. > > int bool = 1; > is completely valid C17 if one doesn't include header, > or > int static_assert = 2; > valid C17 if one doesn't include > etc. These used to compile and will no any longer wheen using -std=c2x or > in a few years when -std=gnu23 becomes the default will not compile by > default, even when it used to be valid C17. The examples you gave are the ones I could accept as "good reasons" for breaking backward compatibility. That's because breaking that is unavoidable if GCC wants to support the newer standard. That is not the case we are discussing, AFAIU. Or at least no one has yet explained why accepting those old K&R programs will adversely affect the ability of GCC to compile C2x programs.