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

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

Re: How do I remove "reference to free variable" warnings onbuffer-local


From: Tassilo Horn
Subject: Re: How do I remove "reference to free variable" warnings onbuffer-local variables?
Date: Mon, 09 Nov 2009 19:58:52 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

"Drew Adams" <drew.adams@oracle.com> writes:

Hi Drew,

> Again, I'm no expert on this. Others will no doubt correct me. But I'm
> pretty sure that the example you gave is not useful: the `boundp' test
> is not needed, and it doesn't do anything, since the "use" of the
> variable for which the warning would be suppressed here is simply
> `(defvar some-variable)', which doesn't issue a warning anyway.

Yes, you are right.  And even if it was bound an additional defvar (even
with an init value) would do no harm.  So simply put a

  (defvar foo)

to suppress the compiler warnings after double-checking that the
warnings are only caused by the fact that the variable is undefined only
at compile time and not at runtime.

Bye,
Tassilo




reply via email to

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