From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: warnings compiling emacs28 with gcc 12.1 Date: Thu, 28 Jul 2022 20:38:23 +0300 Message-ID: <83lesd87e8.fsf@gnu.org> References: <87h731vrmw.fsf@mail.jao.io> <83o7x9892n.fsf@gnu.org> <87bkt9rwkf.fsf@telefonica.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13860"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: =?utf-8?Q?=C3=93scar?= Fuentes Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jul 28 19:41:41 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oH7W0-0003TN-U6 for ged-emacs-devel@m.gmane-mx.org; Thu, 28 Jul 2022 19:41:41 +0200 Original-Received: from localhost ([::1]:57362 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oH7Vz-0004o8-L2 for ged-emacs-devel@m.gmane-mx.org; Thu, 28 Jul 2022 13:41:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50348) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oH7Sj-0003kf-4H for emacs-devel@gnu.org; Thu, 28 Jul 2022 13:38:17 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:52590) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oH7Sh-0006ep-4D; Thu, 28 Jul 2022 13:38:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=msnWfBkICq2ZvT9ZXioCy8ZK10OVE6wpCa5qMAGG230=; b=IkUwNqb7sjsXiZz8/rp0 qdOgCm01ISHYXSJJCFAxHZDRHnPee6YNo/I+hJD4iXqSOWrkwJMPvJ4K7Xvcbjlk9KVNkTnFwpkZi Vm+mqyeWvKjG3i7nm19Il8J2vK4dVuL2EplbRcv3TnyT8okhkpU2VSeQwk66bA8u3Yd4cP4NmkVVt bfD7PuXPOwwwFcs5/VwnyoZ0pPp0hTUM0+HAypGMVDsducIgyvkLsWe/GCljNXs/CEbs0X1gLPqGq 2Ccz8VbYb3wzgb/wvn3nkO8dzcIy6uGuo+96J7+M60O175eVinxB2ihA9UXneTazvXMfP8JcvY+q/ ZHtsmNQ+DHV7Vw==; Original-Received: from [87.69.77.57] (port=2946 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oH7Sg-0003jZ-Dl; Thu, 28 Jul 2022 13:38:14 -0400 In-Reply-To: <87bkt9rwkf.fsf@telefonica.net> (message from =?utf-8?Q?=C3=93scar?= Fuentes on Thu, 28 Jul 2022 19:12:00 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:292799 Archived-At: > From: Óscar Fuentes > Date: Thu, 28 Jul 2022 19:12:00 +0200 > > Eli Zaretskii writes: > > >> and there's another one about free that looks a bit scary: > >> > >> alloc.c: In function ‘lisp_free’: > >> alloc.c:1052:3: warning: pointer ‘block’ used after ‘free’ [-Wuse-after-free] > >> 1052 | mem_delete (mem_find (block)); > >> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > >> alloc.c:1050:3: note: call to ‘free’ here > >> 1050 | free (block); > >> | ^~~~~~~~~~~~ > > > > Another nonsense. Look in mem_find, and you will see that it uses its > > argument as just a number, it never dereferences it. > > The warning is not about dereferencing the pointer. What other problems could be caused by using it after freeing it?