From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zimbra.cs.ucla.edu (zimbra.cs.ucla.edu [131.179.128.68]) by sourceware.org (Postfix) with ESMTPS id AC0673854568 for ; Thu, 17 Nov 2022 22:27:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AC0673854568 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=cs.ucla.edu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cs.ucla.edu Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 27DA7160037; Thu, 17 Nov 2022 14:27:32 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id cJznGTC0qAi3; Thu, 17 Nov 2022 14:27:31 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 3E391160043; Thu, 17 Nov 2022 14:27:31 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.9.2 zimbra.cs.ucla.edu 3E391160043 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=78364E5A-2AF3-11ED-87FA-8298ECA2D365; t=1668724051; bh=0zmeGZHdwMV51ZR87PKwlkZk74/SnEPp2hRE/wLf5Xs=; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type: Content-Transfer-Encoding; b=UtT61nZE+PS/uGskLR+ClTSONxxXrG4bBv+38WHZ9V3r2iACXUagMSxF/E2JqFG5C DwC9W7mif9fxymlCVNkiOXuURQ5C/YnL/WZrYED+MRAYFLQMfGwRYWZQFCDWEyb8H+ 5SYfAgCfivg8G3BvrZqx/HpxL0ZI6QZs/4sBinXo= X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id IVCPuYrSFxAK; Thu, 17 Nov 2022 14:27:31 -0800 (PST) Received: from [131.179.64.200] (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 0FAB4160037; Thu, 17 Nov 2022 14:27:31 -0800 (PST) Message-ID: <0b021fa0-486b-0ea1-8bbc-f14053e84d71@cs.ucla.edu> Date: Thu, 17 Nov 2022 14:27:30 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: How can Autoconf help with the transition to stricter compilation defaults? Content-Language: en-US To: Bruno Haible Cc: Jonathan Wakely , Aaron Ballman , c-std-porting@lists.linux.dev, Autoconf Development , gcc@gcc.gnu.org, cfe-commits@lists.llvm.org, bug-gnulib@gnu.org, Zack Weinberg , Michael Matz References: <24ed5604-305a-4343-a1b6-a789e4723849@app.fastmail.com> <8101f5cb-082b-8c25-bdf0-7d1cd2531388@cs.ucla.edu> <2685416.gqKg17ZAdu@nimes> From: Paul Eggert Organization: UCLA Computer Science Department In-Reply-To: <2685416.gqKg17ZAdu@nimes> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,JMQ_SPF_NEUTRAL,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,TXREP 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 11/17/22 13:35, Bruno Haible wrote: > Clang will surely not acquire knowledge about "every library", right, > only about the C library according to relevant standards (ISO C, POSIX)? I don't know the Clang developers' plans. But if I wanted Clang to be picky then yes, I'd have it know about every library the program links to. It's some work but doable via techniques like -flto. Let's hope this isn't enabled by default. > There is a > documented way to ask Clang and GCC "assume a free-standing implementation, > not an environment that has the ISO C / POSIX / LSB / ... functions": > 1) -ffreestanding [1][2] > 2) -fno-builtin Thanks, good suggestion. If this suffices to pacify Clang, we can use it in Autoconf: that is, we cause ./configure to link a simple program with -fno-builtin and if that works, then ./configure uses -fno-builtin when doing "does this function exist?" link-time tests. This hack wouldn't suffice if Clang starts doing link-time type checking by default. However, link-time type checking doesn't seem to be on the Clang developers' to-do list, so we should be OK at least for now.