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-Status: No, score=-4.7 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,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 6BAE61F4B4 for ; Sun, 3 Jan 2021 03:22:06 +0000 (UTC) Received: from localhost ([::1]:44004 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kvty1-0005yn-76 for normalperson@yhbt.net; Sat, 02 Jan 2021 22:22:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53144) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kvtxy-0005yf-JA for bug-gnulib@gnu.org; Sat, 02 Jan 2021 22:22:02 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:57134) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kvtxt-0006HB-Fs for bug-gnulib@gnu.org; Sat, 02 Jan 2021 22:22:01 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 80A28160089; Sat, 2 Jan 2021 19:21:53 -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 Fi6p0xFPLv1m; Sat, 2 Jan 2021 19:21:49 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 71383160099; Sat, 2 Jan 2021 19:21:49 -0800 (PST) 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 Lf8_E9X2kTna; Sat, 2 Jan 2021 19:21:49 -0800 (PST) Received: from [192.168.1.9] (cpe-23-243-218-95.socal.res.rr.com [23.243.218.95]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 3AF8B16008A; Sat, 2 Jan 2021 19:21:49 -0800 (PST) To: Bruno Haible References: <2624561.TfKlLiq1dV@omega> From: Paul Eggert Organization: UCLA Computer Science Department Subject: Re: vasnprintf.c vs GCC11's -Wanalyzer-null-argument (and glibc-2.31) Message-ID: <9391b43b-e6e1-9aee-833c-be719a3083fd@cs.ucla.edu> Date: Sat, 2 Jan 2021 19:21:48 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <2624561.TfKlLiq1dV@omega> Content-Type: multipart/mixed; boundary="------------28BCBCAEC6F4CC2CA746ADFB" Content-Language: en-US Received-SPF: pass client-ip=131.179.128.68; envelope-from=eggert@cs.ucla.edu; helo=zimbra.cs.ucla.edu X-Spam_score_int: -52 X-Spam_score: -5.3 X-Spam_bar: ----- X-Spam_report: (-5.3 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-1.118, RCVD_IN_DNSWL_MED=-2.3, 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.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: bug-gnulib@gnu.org, Jim Meyering Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" This is a multi-part message in MIME format. --------------28BCBCAEC6F4CC2CA746ADFB Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable On 1/2/21 5:49 PM, Bruno Haible wrote: > The vast majority of -Wanalyzer* warnings that we have seen so far were= false > alarms [1]. I've had such bad luck with those warnings that I have not been much=20 motivated to file GCC bug reports for them. I guess the warnings are=20 helpful with low-quality code, but I think I've only found one bug with=20 them in many months of using them on several GNU projects, as compared=20 to a lot of false alarms. I'm almost tempted to disable them in Gnulib=20 by default. For diffutils I worked around the problem by installing the attached=20 patch, which disables the warning in Gnulib code. Without the attached patch I got the same warning that Jim got, when I=20 used GCC 10.2.1 20201125 (Red Hat 10.2.1-9) x86-64. I got more warnings=20 elsewhere in Gnulib when I used gcc (Ubuntu 10.2.0-13ubuntu1) 10.2.0=20 x86-64, but I'd rather not work around those bugs as we can just ask=20 people to use --disable-gcc-warnings if their GCC is old. --------------28BCBCAEC6F4CC2CA746ADFB Content-Type: text/x-patch; charset=UTF-8; name="0001-maint-work-around-GCC-Wreturn-local-addr-bug.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-maint-work-around-GCC-Wreturn-local-addr-bug.patch" =46rom f88b033174c4fa816d3b146312820725c658f707 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 2 Jan 2021 19:07:53 -0800 Subject: [PATCH] maint: work around GCC -Wreturn-local-addr bug * configure.ac: Do not use -Wreturn-local-addr in Gnulib, to suppress a false alarm in vasnprintf.c. --- configure.ac | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configure.ac b/configure.ac index ef01345..3b2195e 100644 --- a/configure.ac +++ b/configure.ac @@ -95,6 +95,10 @@ if test "$gl_gcc_warnings" =3D yes; then nw=3D"$nw -Wsuggest-attribute=3Dpure" nw=3D"$nw -Wduplicated-branches" # Too many false alarms =20 + # Avoid false alarm in lib/vasnprintf.c. + # https://lists.gnu.org/r/bug-gnulib/2021-01/msg00031.html + gl_WARN_ADD([-Wno-analyzer-null-argument]) + gl_WARN_ADD([-Wno-return-local-addr]) # avoid this false alarm: # careadlinkat.c: In function 'careadlinkat': # cc1: error: function may return address of local variable [-Werror=3D= return-local-addr] --=20 2.27.0 --------------28BCBCAEC6F4CC2CA746ADFB--