GNU bug report logs - #67568
Emacs master: Bug in byte compiler when there's an unused parameter.

Previous Next

Package: emacs;

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

Date: Fri, 1 Dec 2023 12:51:01 UTC

Severity: normal

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 67568 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Alan Mackenzie <acm <at> muc.de>
Cc: Dmitry Gutov <dmitry <at> gutov.dev>, 67568 <at> debbugs.gnu.org
Subject: Re: bug#67568: Emacs master: Bug in byte compiler when there's an
 unused parameter.
Date: Fri, 01 Dec 2023 10:40:55 -0500
> I have a candidate for the buggy function, namely macroexp-parse-body.

Duh!
I think the patch below should fix it.


        Stefan


diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el
index 6eb670d6dc1..6ed3e0c4896 100644
--- a/lisp/emacs-lisp/macroexp.el
+++ b/lisp/emacs-lisp/macroexp.el
@@ -540,7 +540,9 @@ macroexp-parse-body
       (while
           (and body
                (let ((e (car body)))
-                 (or (stringp e)
+                 (or (and (stringp e)
+                          ;; Only the first string can be a docstring.
+                          (not (delq nil (mapcar #'stringp decls))))
                      (memq (car-safe e)
                            '(:documentation declare interactive cl-declare)))))
         (push (pop body) decls)))





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

Previous Next


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