GNU bug report logs - #41287
28.0.50; Spurious warning "Unused lexical"

Previous Next

Package: emacs;

Reported by: Michael Albinus <michael.albinus <at> gmx.de>

Date: Fri, 15 May 2020 13:45:02 UTC

Severity: minor

Merged with 16206, 31232, 39919

Found in versions 24.3, 26.3, 28.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Philipp Stephani <p.stephani2 <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 41287 <at> debbugs.gnu.org
Subject: bug#41287: 28.0.50; Spurious warning "Unused lexical"
Date: Fri, 15 May 2020 16:07:55 +0200
Am Fr., 15. Mai 2020 um 15:45 Uhr schrieb Michael Albinus
<michael.albinus <at> gmx.de>:
>
>
> I have the following defun in tramp.el (my local repo)
>
> --8<---------------cut here---------------start------------->8---
> (defun tramp-get-signal-strings ()
>   "Strings to return by `process-file' in case of signals."
>   ;; We use key nil for local connection properties.
>   (with-tramp-connection-property nil "signal-strings"
>     (let (result)
>       (if (and (stringp shell-file-name) (executable-find shell-file-name))
>           (dotimes (i 128 (reverse result))
>             (push
>              (if (= i 19) 1 ;; SIGSTOP
>                (call-process
>                 shell-file-name nil nil nil "-c" (format "kill -%d $$" i)))
>              result))
>         (dotimes (i 128 (reverse result))
>           (push (format "Signal %d" i) result))))))
> --8<---------------cut here---------------end--------------->8---
>
> Compiling this, I get
>
> --8<---------------cut here---------------start------------->8---
> tramp.el:5065:1: Warning: Unused lexical variable ā€˜i’
> tramp.el:5065:1: Warning: Unused lexical variable ā€˜i’
> --8<---------------cut here---------------end--------------->8---
>
> `i' is used in both `dotimes' loops. What does the compiler tell me?


This is probably the same as Bug#39919. tl;dr: remove the result
argument from the dotimes form.




This bug report was last modified 4 years and 285 days ago.

Previous Next


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