bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#41287: 28.0.50; Spurious warning "Unused lexical"


From: Philipp Stephani
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@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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]