From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zimbra.cs.ucla.edu (zimbra.cs.ucla.edu [131.179.128.68]) by sourceware.org (Postfix) with ESMTPS id 2652F3858C60 for ; Sat, 22 Jan 2022 00:42:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2652F3858C60 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=cs.ucla.edu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cs.ucla.edu Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 30D7C160193; Fri, 21 Jan 2022 16:42:13 -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 ED_1XjhlBIF9; Fri, 21 Jan 2022 16:42:12 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 75CD2160195; Fri, 21 Jan 2022 16:42:12 -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 ccKc0H0y-wuf; Fri, 21 Jan 2022 16:42:12 -0800 (PST) Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 52AAD160193; Fri, 21 Jan 2022 16:42:12 -0800 (PST) Message-ID: Date: Fri, 21 Jan 2022 16:42:12 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Content-Language: en-US To: Martin Sebor Cc: libc-alpha@sourceware.org References: <6c44a5a2-ed1e-abfe-2ead-9ddb6a97b8fc@gmail.com> From: Paul Eggert Organization: UCLA Computer Science Department Subject: Re: [PATCH] avoid -Wuse-after-free [BZ #26779] In-Reply-To: <6c44a5a2-ed1e-abfe-2ead-9ddb6a97b8fc@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2022 00:42:15 -0000 On 1/21/22 15:14, Martin Sebor wrote: >> >=20 > That does look cleaner although it wasn't entirely obvious to me > from looking at the code that it's the same.=C2=A0 Unfortunately, it > doesn't help.=C2=A0 GCC replaces the bool variable with the equality > test of the two pointers, and the warning points that out. That's a GCC bug. > Pedantically speaking it's a bug in GCC that it does that but > I doubt anyone would care to do anything about it. You might be surprised; they do fix bugs in this area. If I could=20 reproduce the bug I'd file a bug report, but my GCC doesn't complain so=20 I guess it's up to you.... > his only > happens at level 3 (i.e., above the default 2), so if you want > a clean build at that level you can either take the patch as is > or use #pragma GCC diagnostic to suppress the warning. Otherwise, > if all you care about is -Wall, then you can drop this part of > the patch. We shouldn't drop the patch or use a pragma, since this is a genuine bug=20 in glibc that should get fixed. If the only option is to use the patch=20 as-is then let's do that. Though I do wish the GCC bug were fixed.