GNU bug report logs -
#74145
31.0.50; Default lexical-binding to t
Previous Next
Full log
Message #87 received at 74145 <at> debbugs.gnu.org (full text, mbox):
> They definitely might not understand the differences between the two
> flavors well enough to know what to expect. For example, warnings
> from the byte compiler about "unused lexical variable" might be
> extremely puzzling if those differences are not well understood,
> because to someone who is used to dynamic binding, the code looks
> 100% legit.
That's what the doc tries to explain:
A warning about an unused variable may be a good hint that the
variable was intended to be dynamically scoped (because it is
actually used, but in another function), but it may also be an
indication that the variable is simply really not used and could
simply be removed. So you need to find out which case it is, and
based on that, either add a @code{defvar} or remove the variable
altogether. If removal is not possible or not desirable (typically
because it is a formal argument and that we cannot or don't want to
change all the callers), you can also add a leading underscore to
the variable's name to indicate to the compiler that this is
a variable known not to be used.)
- Stefan
This bug report was last modified 68 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.