From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 1911E1F910 for ; Thu, 17 Nov 2022 21:36:05 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=clisp.org header.i=@clisp.org header.b="q9G+qyX0"; dkim-atps=neutral Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ovmYB-0008PY-SG; Thu, 17 Nov 2022 16:35:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ovmYA-0008PK-Ft; Thu, 17 Nov 2022 16:35:58 -0500 Received: from mo4-p01-ob.smtp.rzone.de ([85.215.255.51]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ovmY8-0002Vb-Cr; Thu, 17 Nov 2022 16:35:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1668720945; s=strato-dkim-0002; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=D4wxY5hH0Ai63Ym0i9maD8KUD2lpQQ7sCVOJDFqpcGw=; b=q9G+qyX0Vn639chH4ZcYsynmk8BwBoWRxXI7U4gKwy4nezRl+ouH1uz0CsJoIKa607 GgFfqqgiLA2PHF8TNEAimVuBVug/0GTU2ldA05go3rWVidYgNXaHcKAgvjT2Q1GwF4Wv Bf3n3vRNlUPzSmoWv0+6OdH0d8OObauMSGgxYGfx2pqiP/+tKqaxxXXuJQbvwivqdKrH olzl+Ma2zy8XyIOCyq65726b/3spj5wvzF9zTNWohN+feC0OGqEaKfnbWjpnLTiB61LC QkBw5MvBcARrBqknoSHFtANM6l1JI1vaUjq3cSVg7bWbAiFxu4hcqh8SCGinD/SdlqUb hSYw== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH0WWb0LN8XZoH94zq68+3cfpPA3vziun9YbsgocR3TuRiWfWfxgA==" X-RZG-CLASS-ID: mo00 Received: from nimes.localnet by smtp.strato.de (RZmta 48.2.1 AUTH) with ESMTPSA id v9c7e6yAHLZiAuV (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Thu, 17 Nov 2022 22:35:44 +0100 (CET) From: Bruno Haible To: Zack Weinberg , Michael Matz , Paul Eggert 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 Subject: Re: How can Autoconf help with the transition to stricter compilation defaults? Date: Thu, 17 Nov 2022 22:35:44 +0100 Message-ID: <2685416.gqKg17ZAdu@nimes> In-Reply-To: <8101f5cb-082b-8c25-bdf0-7d1cd2531388@cs.ucla.edu> References: <24ed5604-305a-4343-a1b6-a789e4723849@app.fastmail.com> <8101f5cb-082b-8c25-bdf0-7d1cd2531388@cs.ucla.edu> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Received-SPF: none client-ip=85.215.255.51; envelope-from=bruno@clisp.org; helo=mo4-p01-ob.smtp.rzone.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Paul Eggert wrote: > > AC_CHECK_FUNC *should not* just probe for linkability of a symbol > > ... Autoconf cannot > be expected to know every signature of every function in every library. Clang will surely not acquire knowledge about "every library", right, only about the C library according to relevant standards (ISO C, POSIX)? > ... In the meantime if > Clang becomes pickier by default it would be helpful if there were a > well-defined way to shut off Clang's pickiness. To me it seems the problem is not Clang's pickiness, but rather the assumptions that it makes about the target environment. 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 Can we assume that these options will continue to work? If so, all Autoconf needs to do is to pass these options to the compiler in AC_CHECK_FUNC checks. Then we don't need to add knowledge about each of the hundreds of standard libc functions into Autoconf. Bruno [1] https://clang.llvm.org/docs/ClangCommandLineReference.html [2] https://gcc.gnu.org/onlinedocs/gcc-12.2.0/gcc/C-Dialect-Options.html