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.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, 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 C0E251F910 for ; Wed, 16 Nov 2022 15:36:19 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ovKS5-0004cJ-8C; Wed, 16 Nov 2022 10:35:49 -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 1ovKRp-0004Wn-TF; Wed, 16 Nov 2022 10:35:44 -0500 Received: from woodpecker.gentoo.org ([140.211.166.183] helo=smtp.gentoo.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1ovKRn-00061G-I3; Wed, 16 Nov 2022 10:35:33 -0500 Content-Type: multipart/signed; boundary="Apple-Mail=_6CBEB47A-2714-479D-B040-A29DC401D735"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.200.110.1.12\)) Subject: Re: How can Autoconf help with the transition to stricter compilation defaults? From: Sam James In-Reply-To: Date: Wed, 16 Nov 2022 15:35:08 +0000 Cc: Michael Matz , Alexander Monakov , Paul Eggert , Jonathan Wakely , Aaron Ballman , Zack Weinberg , c-std-porting@lists.linux.dev, Autoconf Development , GCC Development , cfe-commits@lists.llvm.org, Gnulib bugs Message-Id: <00C3EDCD-D2DA-4B0D-8A8A-08B76552D865@gentoo.org> 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> <27264d94-9496-d7ef-6716-f43db86f38e2@ispras.ru> To: Richard Biener , Aaron Ballman X-Mailer: Apple Mail (2.3731.200.110.1.12) Received-SPF: pass client-ip=140.211.166.183; envelope-from=sam@gentoo.org; helo=smtp.gentoo.org X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham 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 --Apple-Mail=_6CBEB47A-2714-479D-B040-A29DC401D735 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On 16 Nov 2022, at 15:27, Richard Biener = wrote: >=20 > On Wed, Nov 16, 2022 at 4:02 PM Michael Matz via Gcc = wrote: >>=20 >> Hey, >>=20 >> On Wed, 16 Nov 2022, Alexander Monakov wrote: >>=20 >>>> The idea is so obvious that I'm probably missing something, why = autoconf >>>> can't use that idiom instead. But perhaps the (historic?) reasons = why it >>>> couldn't be used are gone now? >>>=20 >>> Ironically, modern GCC and LLVM optimize '&foobar !=3D 0' to '1' = even at -O0, >>> and thus no symbol reference remains in the resulting assembly. >>=20 >> Err, right, *head-->table*. >> Playing with volatile should help: >>=20 >> char foobar(void); >> char (* volatile ptr)(void); >> int main(void) { >> ptr =3D foobar; >> return ptr !=3D 0; >> } >=20 > using printf for foobar this works even with GCC 2.95.2 and with trunk > and -Wall diagnoses >=20 > t.c:1:6: warning: conflicting types for built-in function 'printf'; > expected 'int(const char *, ...)' [-Wbuiltin-declaration-mismatch] > 1 | char printf(void); > | ^~~~~~ > t.c:1:1: note: 'printf' is declared in header '' > +++ |+#include > 1 | char printf(void); >=20 > so without -Werror this should be fine. >=20 Unrelated but I was a bit tempted to ask for throwing in = -Wbuiltin-declaration-mismatch to default -Werror while Clang 16 was at it, but I suppose we don't want = the world to burn too much, and it's got a very obvious usecase (this one) whereas = implicit func decls are too hard to justify. > Richard. --Apple-Mail=_6CBEB47A-2714-479D-B040-A29DC401D735 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iNUEARYKAH0WIQQlpruI3Zt2TGtVQcJzhAn1IN+RkAUCY3UDLF8UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0MjVB NkJCODhERDlCNzY0QzZCNTU0MUMyNzM4NDA5RjUyMERGOTE5MAAKCRBzhAn1IN+R kBCXAP9BdX2hjbcXRqMriNr3kyJZDWBGzB3la2YEKTaQudXIrgD/evpVBl5ulRGC YyuE53QVS/jN7AtnhcodJFt0q5cJJg8= =3Llf -----END PGP SIGNATURE----- --Apple-Mail=_6CBEB47A-2714-479D-B040-A29DC401D735--