From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 2BC2A3AA8019 for ; Thu, 17 Nov 2022 13:30:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2BC2A3AA8019 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 15BE01F8E2; Thu, 17 Nov 2022 13:30:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1668691828; h=from:from:reply-to: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=S9s3euRI52E23U0lyqtXLN5IP0BEP4LaY/n3T/kn7N8=; b=0HJ2JeresGEZ6fwPT+ac5+Li6jdivKakWb05xkxlTyWNz0hh2e0cXLHzoBCv4cc51UAkKV IX1cxZroyhAOC7A80SWnyeH9QKTYlz8IbyPWK2n38WIioNKaM/GMFsMgR9R9Pw6dpL16VO e1rEp7Riurhzm3NEon8tt6UorXglBs4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1668691828; h=from:from:reply-to: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=S9s3euRI52E23U0lyqtXLN5IP0BEP4LaY/n3T/kn7N8=; b=69Fd7ufmGkp0bw6pl8PeAreXHg3xyrWs3He5P2p+sI8A0MwibkyaeXOVn0eoizwOb0oe1m dPZGGeOu4Oqm37CQ== Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id B28B92C141; Thu, 17 Nov 2022 13:30:26 +0000 (UTC) Received: by wotan.suse.de (Postfix, from userid 10510) id 8B4B2635A; Thu, 17 Nov 2022 13:30:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by wotan.suse.de (Postfix) with ESMTP id 8920C6266; Thu, 17 Nov 2022 13:30:26 +0000 (UTC) Date: Thu, 17 Nov 2022 13:30:26 +0000 (UTC) From: Michael Matz To: Paul Eggert cc: Jonathan Wakely , Aaron Ballman , Zack Weinberg , c-std-porting@lists.linux.dev, autoconf@gnu.org, gcc@gcc.gnu.org, cfe-commits@lists.llvm.org, Gnulib bugs Subject: Re: How can Autoconf help with the transition to stricter compilation defaults? In-Reply-To: <4cfa16b3-e9e0-0ec0-659c-e4aef6090995@cs.ucla.edu> Message-ID: References: <24ed5604-305a-4343-a1b6-a789e4723849@app.fastmail.com> <251923e7-57be-1611-be10-49c3067adf0d@cs.ucla.edu> <7ef0ce03-d908-649a-a6ee-89fea374d2b1@cs.ucla.edu> <9cb106e9-16ff-65ec-6a44-6567c77521dc@cs.ucla.edu> <06a5d2cd-44eb-7404-17f3-ff64dd505427@cs.ucla.edu> <4cfa16b3-e9e0-0ec0-659c-e4aef6090995@cs.ucla.edu> User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,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: Hello, On Wed, 16 Nov 2022, Paul Eggert wrote: > On 2022-11-16 06:26, Michael Matz wrote: > > char foobar(void); > > int main(void) { > > return &foobar != 0; > > } > > That still has undefined behavior according to draft C23, This is correct (and also holds for the actually working variant later, with a volatile variable). If your argument is then that as both solutions for the link-test problem are relying on undefined behaviour they are equivalent and hence no change is needed, you have a point, but I disagree. In practice one (with the call) will cause more problems than the other (with address taking). > If Clang's threatened pickiness were of some real use elsewhere, it > might be justifiable for default Clang to break Autoconf. But so far we > haven't seen real-world uses that would justify this pickiness for > Autoconf's use of 'char memset_explicit(void);'. Note that both, GCC and clang, already warn (not error out!) about the mismatching decl, even without any headers. So we are in the pickiness era already. I.e. a C file containing just a single line "char printf(void);" will be warned about, by default. There is about nothing that autoconf could do to rectify this, except containing a long list of prototypes for well-known functions, with the associated maintenance hassle. But autoconf _can_ do something about how the decls are used in the link-tests. Ciao, Michael.