unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: 67483@debbugs.gnu.org
Subject: bug#67483: Wrong warning position given by the byte compiler for a malformed function
Date: Mon, 27 Nov 2023 12:40:49 +0000	[thread overview]
Message-ID: <ZWSOUXQufCLSlXBi@ACM> (raw)

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





             reply	other threads:[~2023-11-27 12:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-27 12:40 Alan Mackenzie [this message]
2023-11-27 13:14 ` bug#67483: Wrong warning position given by the byte compiler for a malformed function 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZWSOUXQufCLSlXBi@ACM \
    --to=acm@muc.de \
    --cc=67483@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).