From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) by sourceware.org (Postfix) with ESMTPS id 93373392AC23 for ; Tue, 15 Nov 2022 20:36:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 93373392AC23 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=aaronballman.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=aaronballman.com Received: by mail-qk1-x734.google.com with SMTP id p18so10358467qkg.2 for ; Tue, 15 Nov 2022 12:36:41 -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=gKzCRpi40kvbmS0r2UcwxT00is1znkH+x0Gt5E1rPcPh4Wo/R4BUShI3MseSVewu+E N117OYDTAtQIchtcR5z/SVTXDiNR5YcLvRZt3TRn4StcPSUhzCipZ4m8pcEUF7Z3yvP+ mB5yJLTw28HUMGj5qeNTd/CNl+7Ode8eHH/r2SwrSxyHXmrmSL9Nmatv2JEv+LXx6FoO rw8dzCO/8g6f28c8qQ+lirGzgHrEukui9AXYiE4KqNt0fzHV8djYQo6PdKe7zP/8jVH4 ciiwc15DOYv1IAnbVX9Wr32NX4ek3LqvME+KbhwyXUU+D5plMxAOkmNTgJm1AFNnOk2+ XC+g== X-Gm-Message-State: ANoB5plRzyeKZwbfhxJtSFlX1GeTpqpqJ7UjHb75WG41kVB1bfpttRf9 EJi2sxYeAMUkwis3KuMWyp3yMswoKmxuX42d X-Google-Smtp-Source: AA0mqf6AivRyza8hWOKyUA7vMliw7ZKheDYl007JNSDhZAqAgix+XRqN6thnIuc3mB6XNhQ5PqpcaA== X-Received: by 2002:a37:2c81:0:b0:6fa:ffd4:d7d8 with SMTP id s123-20020a372c81000000b006faffd4d7d8mr16700478qkh.696.1668544600703; Tue, 15 Nov 2022 12:36:40 -0800 (PST) Received: from mail-yb1-f174.google.com (mail-yb1-f174.google.com. [209.85.219.174]) by smtp.gmail.com with ESMTPSA id w8-20020a05620a444800b006fb7f94a65bsm4085126qkp.44.2022.11.15.12.36.39 for (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-f174.google.com with SMTP id k84so14388688ybk.3 for ; 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" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,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: 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