From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.10]) by sourceware.org (Postfix) with ESMTPS id 5B9F03858C31 for ; Fri, 17 Feb 2023 13:34:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5B9F03858C31 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=nefkom.net Received: from frontend03.mail.m-online.net (unknown [192.168.6.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4PJCTb5Cq0z1s94d; Fri, 17 Feb 2023 14:34:26 +0100 (CET) Received: from localhost (dynscan3.mnet-online.de [192.168.6.84]) by mail.m-online.net (Postfix) with ESMTP id 4PJCTZ5dCvz1qqlR; Fri, 17 Feb 2023 14:34:26 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan3.mail.m-online.net [192.168.6.84]) (amavisd-new, port 10024) with ESMTP id PRE56nwTu1nM; Fri, 17 Feb 2023 14:34:25 +0100 (CET) X-Auth-Info: iJ0oJKDzTmd2vavogoXGvR7VefZ59cqQni871QJMSOUXC3BTCjE3cMKHjVPdek+E Received: from igel.home (aftr-82-135-86-224.dynamic.mnet-online.de [82.135.86.224]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Fri, 17 Feb 2023 14:34:25 +0100 (CET) Received: by igel.home (Postfix, from userid 1000) id 46C952C1CC0; Fri, 17 Feb 2023 14:34:25 +0100 (CET) From: Andreas Schwab To: Alejandro Colomar via Gcc Cc: Martin Uecker , Jonathan Wakely , Alejandro Colomar , Iker Pedrosa , Florian Weimer , Paul Eggert , Michael Kerrisk , =?utf-8?B?SuKCkeKCmeKCmw==?= Gustedt , David Malcolm , Sam James , Yann Droneaud Subject: Re: Missed warning (-Wuse-after-free) References: <8ed6d28c-69dc-fed8-5ab5-99f685f06fac@gmail.com> <38e7e994a81d2a18666404dbaeb556f3508a6bd6.camel@redhat.com> <23d3a3ff-adad-ac2e-92a6-4e19f4093143@gmail.com> <2148ef80dee2a034ee531d662fc8709d26159ec5.camel@tugraz.at> <0049730a-e28c-0e0f-8d92-695395f1ec21@gmail.com> X-Yow: .. I think I'll KILL myself by leaping out of this 14th STORY WINDOW while reading ERICA JONG'S poetry!! Date: Fri, 17 Feb 2023 14:34:25 +0100 In-Reply-To: <0049730a-e28c-0e0f-8d92-695395f1ec21@gmail.com> (Alejandro Colomar via Gcc's message of "Fri, 17 Feb 2023 12:35:06 +0100") Message-ID: <87mt5c5sbi.fsf@igel.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 Feb 17 2023, Alejandro Colomar via Gcc wrote: > C2x (N3054 is the latest I know): > > If a pointer value is used in an evaluation after > the object the pointer points to (or just past) > reaches the end of its lifetime, > the behavior is undefined. > > > > This new wording doesn't even allow one to use memcmp(3); > just reading the pointer value, however you do it, is UB. But memcmp does not read the value, it reads the object representation, and reading the representation is never UB. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."