Subject: bug#21389: closed (Re: bug#21389: bogus diagnostic about unused lexical variable in eshell/time)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 02 Sep 2020 01:09:01 +0000

Your bug report

#21389: bogus diagnostic about unused lexical variable in eshell/time

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
21389: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21389
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#21389: bogus diagnostic about unused lexical variable in eshell/time
From: Stefan Kangas <[email-masked]>
To: Paul Eggert <[email-masked]>
Cc: [email-masked]
Date: Tue, 1 Sep 2020 18:08:24 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

Paul Eggert <[email-masked]> 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.

Subject: bogus diagnostic about unused lexical variable in eshell/time
From: Paul Eggert <[email-masked]>
To: Emacs bug reports <[email-masked]>
Date: Mon, 31 Aug 2015 14:36:33 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

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.