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: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Alan Mackenzie <acm <at> muc.de>
Cc: 67483 <at> debbugs.gnu.org
Subject: bug#67483: Wrong warning position given by the byte compiler for a malformed function
Date: Mon, 04 Dec 2023 11:44:44 -0500
>     (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.

Also the message should use `"foo"` rather than `foo` (IOW,
the `%s` should be a `%S`).  As a general rule of thumb, `%s` should be
used *only* when displaying the content of a string, and `%S` should be
used for most/all other cases (e.g. when displaying what we expect is
a symbol, like here).


        Stefan





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.