From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#67483: Wrong warning position given by the byte compiler for a malformed function Date: Mon, 4 Dec 2023 18:19:21 +0000 Message-ID: References: <59773797-CC64-4352-9528-4E7593DD3C1F@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28017"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, Stefan Monnier , 67483@debbugs.gnu.org To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 04 19:20:12 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1rADYB-00077k-HT for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 04 Dec 2023 19:20:11 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rADXt-0005vU-8n; Mon, 04 Dec 2023 13:19:53 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rADXs-0005vE-1N for bug-gnu-emacs@gnu.org; Mon, 04 Dec 2023 13:19:52 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rADXr-0000jE-Pa for bug-gnu-emacs@gnu.org; Mon, 04 Dec 2023 13:19:51 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rADY2-0006Jy-Cx for bug-gnu-emacs@gnu.org; Mon, 04 Dec 2023 13:20:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 04 Dec 2023 18:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67483 X-GNU-PR-Package: emacs Original-Received: via spool by 67483-submit@debbugs.gnu.org id=B67483.170171398124255 (code B ref 67483); Mon, 04 Dec 2023 18:20:02 +0000 Original-Received: (at 67483) by debbugs.gnu.org; 4 Dec 2023 18:19:41 +0000 Original-Received: from localhost ([127.0.0.1]:35664 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rADXh-0006J9-76 for submit@debbugs.gnu.org; Mon, 04 Dec 2023 13:19:41 -0500 Original-Received: from mail.muc.de ([193.149.48.3]:17135) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rADXf-0006Iv-Mi for 67483@debbugs.gnu.org; Mon, 04 Dec 2023 13:19:40 -0500 Original-Received: (qmail 3028 invoked by uid 3782); 4 Dec 2023 19:19:22 +0100 Original-Received: from acm.muc.de (pd953aae0.dip0.t-ipconnect.de [217.83.170.224]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 04 Dec 2023 19:19:21 +0100 Original-Received: (qmail 22251 invoked by uid 1000); 4 Dec 2023 18:19:21 -0000 Content-Disposition: inline In-Reply-To: <59773797-CC64-4352-9528-4E7593DD3C1F@gmail.com> X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:275525 Archived-At: Hello, Mattias. On Thu, Nov 30, 2023 at 11:37:31 +0100, Mattias Engdegård wrote: > > Buffer bad-error-position.el:2:4: Warning: `foo' is a malformed function > > .. This position 2:4 is wrong; it is the position of the `let' symbol. > > The correct position would be 3:6, the position of the `if' symbol. > (Actually the correct position would be the position of the string > literal but of course our location tracking system is too simplistic > for that.) Indeed. > Thank you for bringing this to our attention. Now I only saw this from > the reference in your commit message; would you CC me next time? > (Stefan, too, unless he objects.) OK. > I'm modifying your work a bit because we're trying to remove warnings > from the optimiser, not entrenching them there. The warning is now in > cconv but perhaps it should be moved to macroexp-all, it's not very > important. Many people consider accurate diagnostics to be very important. > I hope being able to reshape the front-end a bit later on. Well, I can hardly say thank you, here. You've undone the bug fix, and the bug is there again. Did you actually test it before commiting your change? What should I do, now? Reopen the bug and ask you actually to fix it? Or put the fix back in again myself? You may not like warning handling code in the optimiser, but unless you can come up with something better, its presence there is essential to getting good diagnostics. > Also, we usually prefer let-binding dynamic variables to push-pop > pairs. We do indeed, but here binding the variable simply doesn't work. Parts of the compiler, when they encounter errors, signal an error which gets caught by a condition-case somewhere. This would unbind byte-compile-form-stack before the warning handlers could get a chance to use it. -- Alan Mackenzie (Nuremberg, Germany).