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 E3833385416B for ; Wed, 10 May 2023 16:03:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E3833385416B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683734583; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=QO9eBCrU9dfTBcR20LKhcbaaYXdDihZJOyhEmoh+8eY=; b=fCxS6vLys1tO0J8Ji+qznwA8mgBEKU0wky0PyOFFVhkCSXyLJdvFL0VN6miiabQar9vc3I uI8c93j9bYd/OP+FldvIKZQC9a3brVGGVBHQmHsaSDrYerreevs/v9eBJhn7W0O+VfLFWg 3lyfy6CcAYH+ayyMLhWPJfMZV+DoiIE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-507-y8TZBEg7NKuc163g7obIvg-1; Wed, 10 May 2023 12:02:58 -0400 X-MC-Unique: y8TZBEg7NKuc163g7obIvg-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 27E6C802A95; Wed, 10 May 2023 16:02:58 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.194.156]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DD4A948FB11; Wed, 10 May 2023 16:02:57 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 34AG2sMU3916288 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 10 May 2023 18:02:55 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 34AG2rej3916287; Wed, 10 May 2023 18:02:53 +0200 Date: Wed, 10 May 2023 18:02:53 +0200 From: Jakub Jelinek To: Eli Zaretskii Cc: gabravier@gmail.com, jwakely.gcc@gmail.com, fweimer@redhat.com, gcc@gcc.gnu.org, arsen@aarsen.me Subject: Re: More C type errors by default for GCC 14 Message-ID: Reply-To: Jakub Jelinek 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> MIME-Version: 1.0 In-Reply-To: <83wn1g6w67.fsf@gnu.org> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no 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 Wed, May 10, 2023 at 06:30:40PM +0300, Eli Zaretskii wrote: > > Date: Wed, 10 May 2023 16:22:26 +0200 > > From: Jakub Jelinek > > Cc: Gabriel Ravier , jwakely.gcc@gmail.com, > > fweimer@redhat.com, gcc@gcc.gnu.org, arsen@aarsen.me > > > > > > Are you seriously saying that no accepts-invalid bug should ever be > > > > fixed under any circumstances on the basis that some programmers might > > > > rely on code exploiting that bug ?? > > > > > > Sorry, I'm afraid I don't understand the question. What are > > > "accepts-invalid bugs"? > > > > They are bugs where compiler accepts something that isn't valid in > > the selected language nor considered valid extension. > > So, after the fix we reject something that has been accepted before. > > 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. And here are talking about code that wasn't valid already in C99... Jakub