GNU bug report logs - #21389
bogus diagnostic about unused lexical variable in eshell/time

Previous Next

Package: emacs;

Reported by: Paul Eggert <eggert <at> cs.ucla.edu>

Date: Mon, 31 Aug 2015 21:37:02 UTC

Severity: minor

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 21389 in the body.
You can then email your comments to 21389 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#21389; Package emacs. (Mon, 31 Aug 2015 21:37:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Paul Eggert <eggert <at> cs.ucla.edu>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 31 Aug 2015 21:37:02 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Emacs bug reports <bug-gnu-emacs <at> gnu.org>
Subject: bogus diagnostic about unused lexical variable in eshell/time
Date: Mon, 31 Aug 2015 14:36:33 -0700
To reproduce the problem in a fresh build from Emacs master, do this:

touch lisp/eshell/em-unix.el
make

The output will include the following lines:

eshell/em-unix.el:933:1:Warning: Unused lexical variable ‘args’
eshell/em-unix.el:963:1:Warning: Unused lexical argument ‘args’

The first diagnostic is bogus.  The second one is correct.  Perhaps the 
byte compiler is getting confused by the second one and the confusion is 
affecting the first one.

The first diagnostic is generated for code that starts off like this:

(defun eshell/time (&rest args)
  "Implementation of \"time\" in Lisp."
  (let ((time-args (copy-alist args))
     ...

so the lexical variable ‘args’ is being used.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21389; Package emacs. (Tue, 01 Sep 2015 03:51:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 21389 <at> debbugs.gnu.org
Subject: Re: bug#21389: bogus diagnostic about unused lexical variable in
 eshell/time
Date: Mon, 31 Aug 2015 23:50:44 -0400
> so the lexical variable ‘args’ is being used.

The warning is about the `args' var introduced by the
eshell-eval-using-options macro, whose body looks like:

  `(let* (...
          (args processed-args))
     ,@body-forms))


-- Stefan




Reply sent to Stefan Kangas <stefan <at> marxist.se>:
You have taken responsibility. (Wed, 02 Sep 2020 01:09:01 GMT) Full text and rfc822 format available.

Notification sent to Paul Eggert <eggert <at> cs.ucla.edu>:
bug acknowledged by developer. (Wed, 02 Sep 2020 01:09:01 GMT) Full text and rfc822 format available.

Message #13 received at 21389-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 21389-done <at> debbugs.gnu.org
Subject: Re: bug#21389: bogus diagnostic about unused lexical variable in
 eshell/time
Date: Tue, 1 Sep 2020 18:08:24 -0700
Paul Eggert <eggert <at> cs.ucla.edu> writes:

> To reproduce the problem in a fresh build from Emacs master, do this:
>
> touch lisp/eshell/em-unix.el
> make
>
> The output will include the following lines:
>
> eshell/em-unix.el:933:1:Warning: Unused lexical variable ‘args’
> eshell/em-unix.el:963:1:Warning: Unused lexical argument ‘args’
>
> The first diagnostic is bogus.  The second one is correct.  Perhaps the byte
> compiler is getting confused by the second one and the confusion is affecting
> the first one.
>
> The first diagnostic is generated for code that starts off like this:
>
> (defun eshell/time (&rest args)
>   "Implementation of \"time\" in Lisp."
>   (let ((time-args (copy-alist args))
>      ...
>
> so the lexical variable ‘args’ is being used.

This seems to have been fixed on current master, so I'm closing this bug
report.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 30 Sep 2020 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 180 days ago.

Previous Next


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