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=-4.0 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 19E551F910 for ; Tue, 15 Nov 2022 20:37:00 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ov2fk-0001YN-Ni; Tue, 15 Nov 2022 15:36:44 -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 1ov2fj-0001XY-87 for bug-gnulib@gnu.org; Tue, 15 Nov 2022 15:36:43 -0500 Received: from mail-qk1-x729.google.com ([2607:f8b0:4864:20::729]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ov2fh-00066Y-Gk for bug-gnulib@gnu.org; Tue, 15 Nov 2022 15:36:43 -0500 Received: by mail-qk1-x729.google.com with SMTP id z17so10328222qki.11 for ; Tue, 15 Nov 2022 12:36:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aaronballman.com; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=R5CFBFcb6e4a5NN1FQFpsTuFcS6RlVRL3qErisiA0Dg=; b=WIvqdJQou+sCwYtaluwh2ng8DnEXJfhrOgER7KSyGE5LLWa3t90UNe/WXQbYE893nC IWesp6vyhxOgkuGZD5Gt25qdHd7+FJDShmUUe0YXT9B08/ao+A0hzFKoQLGOwZaakpBi 10uPN9W6itkf1V8qNLpHxQbylvSqpSloqBycinZxnhs7i9COALvvyinVsmVvvAQVTx8/ ow3+liv040Tzyeqn7wbzHE+RVOpX7ko9oZ1JX1+E+yGx+bvDtdoEuGM5JH4R60U3y9Q3 uo2yqtxTy9tgKAlDRtg3dJA1mCz4dpMH/kcQQfecrBilFVpdsglXPLzGH+WR14TGfyC4 YcJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=R5CFBFcb6e4a5NN1FQFpsTuFcS6RlVRL3qErisiA0Dg=; b=5DZcdEwLt/ktnkWKAPl4VYVfTDreQ37VdJMM4GU+mJw+rfhWTdfTp/+cSYsxxSYOAg 7AiNHfIDHtbAoWZDuc5+WwMpmOLxt9S4WwQNX+j+jkgeoOuCeHDZezKGmVUUAtGaknFu UHHNmfrnzIHh6kyuQTS3wSVa1a9n+XrtjGr60cCx64JNMrQBfNp8eoAqxVufbauOqXAW LOX6aOtD3nj9jx4fD78nm3UEMWse4mDQ8kP3924he8oKTmzDlcLOJfMB2p0GbjToMHQA hv+vaPzmfXHqt2IFQFbT1ldlLzPU5b7UyWYiNFv48of60lfobsh1l2Z+EmjJs2q3SgTh 8LIw== X-Gm-Message-State: ANoB5pm9GfZbcxykBmD55MdFne6Ijp5d52DnIUntS1hUr6xIFpXFQNRt Dfkhn9AIdEPu7+gpgnHfgXQkZHEJiiYDXzce X-Google-Smtp-Source: AA0mqf6UN2PTBbOMzSMmBBxr2PfhH854JBwCvkhePn1cbzwzWztvfgRzCIf5KfUlJ8ZIs04bgpxPew== X-Received: by 2002:a05:620a:371d:b0:6fa:d35:8466 with SMTP id de29-20020a05620a371d00b006fa0d358466mr17177243qkb.486.1668544600038; Tue, 15 Nov 2022 12:36:40 -0800 (PST) Received: from mail-yb1-f173.google.com (mail-yb1-f173.google.com. [209.85.219.173]) by smtp.gmail.com with ESMTPSA id r1-20020a05620a298100b006ecf030ef15sm8753715qkp.65.2022.11.15.12.36.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 15 Nov 2022 12:36:39 -0800 (PST) Received: by mail-yb1-f173.google.com with SMTP id b131so17907264yba.11; Tue, 15 Nov 2022 12:36:39 -0800 (PST) X-Received: by 2002:a25:8142:0:b0:6dc:ad4b:a23e with SMTP id j2-20020a258142000000b006dcad4ba23emr19031574ybm.617.1668544598738; Tue, 15 Nov 2022 12:36:38 -0800 (PST) MIME-Version: 1.0 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> In-Reply-To: <9cb106e9-16ff-65ec-6a44-6567c77521dc@cs.ucla.edu> From: Aaron Ballman Date: Tue, 15 Nov 2022 15:36:22 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: How can Autoconf help with the transition to stricter compilation defaults? To: Paul Eggert Cc: Jonathan Wakely , Zack Weinberg , c-std-porting@lists.linux.dev, autoconf@gnu.org, gcc@gcc.gnu.org, cfe-commits@lists.llvm.org, Gnulib bugs Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2607:f8b0:4864:20::729; envelope-from=aaron@aaronballman.com; helo=mail-qk1-x729.google.com 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_NONE=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 On Tue, Nov 15, 2022 at 2:08 PM Paul Eggert wrote: > > On 2022-11-15 06:50, Jonathan Wakely wrote: > > Could you clarify what you mean, with a concrete example? Surely as > > long as errors are reported on stderr and the compiler exits with > > non-zero status, that's an acceptable way to report errors? > > Not if the "error" is harmless as far as Autoconf is concerned, which is > what led to this thread. The concrete example here is that Autoconf > needs to check whether a function can be linked to (as opposed to > checking the function's signature). Clang shouldn't get in the way. What is harmless to autoconf is a critical flaw in another context. > In lots of places the C standard says behavior is undefined, even though > the behavior is fine on the current platform for the intended use. It's > not just the example we're talking about; adding zero to a null pointer > is another such example. > > In such cases it's OK for Clang to warn, but having Clang exit with > nonzero status is overkill and counterproductive. I don't know that this is particularly persuasive -- it effectively boils down to another variant of "I want to rely on a specific behavior for something that is UB". I don't think Clang can promise that we're not going to turn more statically-known UB into errors. ~Aaron