[Top][All Lists]

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

RE: Science to suppress compiler warnings

From: Drew Adams
Subject: RE: Science to suppress compiler warnings
Date: Tue, 2 Jun 2009 16:57:10 -0700

> (eval-when-compile (defvar foo nil))

(eval-when-compile (defvar foo))

You don't give it a value; you just declare it (to the compiler).

> Warning: reference to free variable `records-link-menu-map'
> Warning: assignment to free variable `records-link-menu-map'
> What is the difference between these two warnings exactly ?

The first means the variable is used (referenced) somehow.
The second means that it is assigned to.

E.g., (setq foo bar) refers to variable `bar', and if it's free, then you get
the first warning. (setq bar 5) assigns `bar' a value, which will give you the
second warning (if `bar' is free).

reply via email to

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