GNU bug report logs - #67483
Wrong warning position given by the byte compiler for a malformed function

Previous Next

Package: emacs;

Reported by: Alan Mackenzie <acm <at> muc.de>

Date: Mon, 27 Nov 2023 12:42:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Alan Mackenzie <acm <at> muc.de>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#67483: closed (Wrong warning position given by the byte
 compiler for a malformed function)
Date: Mon, 27 Nov 2023 15:49:01 +0000
[Message part 1 (text/plain, inline)]
Your message dated Mon, 27 Nov 2023 15:47:47 +0000
with message-id <ZWS6I_CldqvHTQPk <at> ACM>
and subject line Re: bug#67483: Wrong warning position given by the byte compiler for a malformed function
has caused the debbugs.gnu.org bug report #67483,
regarding Wrong warning position given by the byte compiler for a malformed function
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
67483: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=67483
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Alan Mackenzie <acm <at> muc.de>
To: bug-gnu-emacs <at> gnu.org
Subject: Wrong warning position given by the byte compiler for a malformed
 function
Date: Mon, 27 Nov 2023 12:40:49 +0000
Hello, Emacs

In any recent or semi-recent Emacs create a file bad-error-position.el
with these contents:

    (defun foo ()
      (let ((bar 'bar))
        (if ("foo")  ; Erroneous "function".
            (baz))))))

..  Use M-x compile-defun to compile it.  This gives an error message:

    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.

#########################################################################

The cause of the error is in byte-optimize-form in
lisp/emacs-lisp/byte-opt.el.  There, although the code recurses, it
fails to push the current form onto byte-compile-form-stack.  Thus when
byte-compile-warn-x is called, there is nothing usable on that stack
inside the let form.

-- 
Alan Mackenzie (Nuremberg, Germany).


[Message part 3 (message/rfc822, inline)]
From: Alan Mackenzie <acm <at> muc.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 67483-done <at> debbugs.gnu.org, acm <at> muc.de
Subject: Re: bug#67483: Wrong warning position given by the byte compiler for
 a malformed function
Date: Mon, 27 Nov 2023 15:47:47 +0000
Hello, Eli.

On Mon, Nov 27, 2023 at 17:09:10 +0200, Eli Zaretskii wrote:
> > Date: Mon, 27 Nov 2023 14:01:40 +0000
> > Cc: 67483 <at> debbugs.gnu.org, acm <at> muc.de
> > From: Alan Mackenzie <acm <at> muc.de>

> > > > > Which branch? master or emacs-29?

> > > > Both.  Probably emacs-28, too.

> > > So it isn't a "semi-recent" problem, is it?

> > It isn't ten years old, either.  I have a fix ready to commit to the
> > master branch.

> > Seeing as how the bug isn't recently introduced, and isn't a critical
> > bug, I'm assuming the patch is not destined for the release branch.

> Definitely not.

No.  I've committed the fix to master, and I'm closing the bug.

-- 
Alan Mackenzie (Nuremberg, Germany).


This bug report was last modified 1 year and 156 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.