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.133.124]) by sourceware.org (Postfix) with ESMTPS id 4F0693857702 for ; Wed, 10 May 2023 12:26:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4F0693857702 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=1683721569; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zv0DJEk7iFW/uqQbGSLjET0Aee9oo5JQW1Qizd41LRo=; b=OVINtl2NShA9ybZrodY2EKBOz2O84h8SR6bebMCtstEvGDIqcr+k8CaV9Px786IDcBeYvT X/GcKT1PPgmSXeFFLK+FQJgd+zQwfa3tgyjddlZDxsSgWE71ioYLwi5VwnZ9xjAYKfioeX UwPvpTH59I860MMv4GA+KEIQOoVK4fw= 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-68-nxR9FB7NNXm7sn_AQ5ZnQA-1; Wed, 10 May 2023 08:26:06 -0400 X-MC-Unique: nxR9FB7NNXm7sn_AQ5ZnQA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A190688CC43; Wed, 10 May 2023 12:26:05 +0000 (UTC) Received: from oldenburg3.str.redhat.com (unknown [10.39.195.11]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F352D2026D25; Wed, 10 May 2023 12:26:03 +0000 (UTC) From: Florian Weimer To: Richard Biener Cc: Jonathan Wakely , Eli Zaretskii , "gcc@gcc.gnu.org" , Jakub Jelinek , Arsen =?utf-8?Q?Arsenovi=C4=87?= Subject: Re: More C type errors by default for GCC 14 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> <87y1lx1avj.fsf@oldenburg.str.redhat.com> <83ednoapb6.fsf@gnu.org> Date: Wed, 10 May 2023 14:26:02 +0200 In-Reply-To: (Richard Biener's message of "Wed, 10 May 2023 10:46:02 +0200") Message-ID: <87sfc4qso5.fsf@oldenburg3.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.2 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,RCVD_IN_MSPIKE_H2,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: * Richard Biener: > On Wed, May 10, 2023 at 10:05=E2=80=AFAM Jonathan Wakely via Gcc > wrote: >> >> On Wed, 10 May 2023, 03:32 Eli Zaretskii, wrote: >> >> > >> > And then people will start complaining about GCC unnecessarily >> > erroring out, which is a compiler bug, since there's no problem >> > producing correct code in these cases. >> > >> >> >> What is the correct code for this? >> >> void foo(int); >> void bar() { foo("42"); } >> >> Why should this compile? >> >> You keep demanding better rationale for the change, but your argument >> amounts to nothing more than "it compiles today, it should compile >> tomorrow". > > void foo(__UINTPTR_TYPE__); > void bar() { foo("42"); } > > might be something we'd still like to diagnose but eventually not turn > into an error? Yes, it then depends on the target whether the code is > accepted or not, but at least it would continue working where there's > a "good" answer to your question. The x86-64 defaults for GNU/Linux were originally set in such a way that there is a good chance that pointers fit into an int, and broken code like that happens to work (as long as it's in the main program). Of course I think we should nevertheless reject it by default. Anyway, if int-conversion somehow proves more controversial, I believe disabling implicit-int and implicit-function-declaration by default would still be a huge step forward. Thanks, Florian