GNU bug report logs -
#41287
28.0.50; Spurious warning "Unused lexical"
Previous Next
Full log
View this message in rfc822 format
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.