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 40D2D3858C50 for ; Thu, 3 Nov 2022 10:37:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 40D2D3858C50 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=1667471861; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=MrLpiCYYqjOrDA/sK3oV2fnpHEPv9u563EwfdoT7MVA=; b=XT5BdZXTy7V059scq8cLtlh/GbkCAKP/hjvZQWJZPW+GMNhlUwROhYWBIFZaopNVtxRJ81 v44a+e4JkTvb/4AfekRQWvPTEhzuQWuDOM2Gmkp9DvZs/7bJj7izDzchJ0Z75aVj4C3avk YbDIa0nfQTNGPfOKSRex1ZAlhuCz0cw= 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-342-S0IpCUy3NUSPSisfY0txMA-1; Thu, 03 Nov 2022 06:37:38 -0400 X-MC-Unique: S0IpCUy3NUSPSisfY0txMA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EF9AA858F17 for ; Thu, 3 Nov 2022 10:37:37 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.64]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5ABCAC15BA4 for ; Thu, 3 Nov 2022 10:37:37 +0000 (UTC) From: Florian Weimer To: gcc@gcc.gnu.org Subject: Local type inference with auto is in C2X Date: Thu, 03 Nov 2022 11:37:35 +0100 Message-ID: <87zgd8fhn4.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP 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: So apparently auto was voted in to the committee draft of C2X at the last minute. I wonder how this aligns with the WG14 charter, given the lack of implementation experience with this feature, but it looks like we are now stuck with it. My main worry is that both Clang and GCC still enable implicit ints by default. This means that auto variables have type int always, and that can subtly alter the meaning of programs. The only indication that this has happened in a code base is a warning that went away (!). I don't like that. My original plan was to port upstreams & distributions away from implicit ints (again, configure scripts are problematic), and then have at least one GCC release that disables implicit ints in the default language mode. But I'm not sure if that's now possible: the porting will not have propagated widely once GCC 13 releases, so rejecting implicit ints in GCC 13 might be too early. GCC 14 might want to switch to C23/C24 mode by default, activating auto support, if the standard comes out in 2023 (which apparently is the plan). Then we would go from warning to changed semantics in a single release. Comments? Thanks, Florian