unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#67483: Wrong warning position given by the byte compiler for a malformed function
@ 2023-11-27 12:40 Alan Mackenzie
  2023-11-27 13:14 ` Eli Zaretskii
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Alan Mackenzie @ 2023-11-27 12:40 UTC (permalink / raw)
  To: 67483

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).





^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2024-01-13 14:05 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-27 12:40 bug#67483: Wrong warning position given by the byte compiler for a malformed function Alan Mackenzie
2023-11-27 13:14 ` Eli Zaretskii
2023-11-27 13:20   ` Alan Mackenzie
2023-11-27 13:50     ` Eli Zaretskii
2023-11-27 14:01       ` Alan Mackenzie
2023-11-27 15:09         ` Eli Zaretskii
2023-11-27 15:47           ` Alan Mackenzie
2023-11-30 10:37 ` Mattias Engdegård
2023-12-04 18:19   ` Alan Mackenzie
2023-12-19 18:23     ` Mattias Engdegård
2023-12-21 12:22     ` Mattias Engdegård
2023-12-22 11:24       ` Alan Mackenzie
2023-12-22 13:12         ` Mattias Engdegård
2023-12-22 20:09           ` Alan Mackenzie
2024-01-13 14:05             ` Alan Mackenzie
2023-12-04 16:44 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found] ` <handler.67483.B.170108887925620.ack@debbugs.gnu.org>
2023-12-08 20:19   ` bug#67483: Acknowledgement (Wrong warning position given by the byte compiler for a malformed function) Alan Mackenzie

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).