Changes by: Jason Hickey (jyh at cs.caltech.edu)
Date: 2005-08-31 22:18:47 -0700 (Wed, 31 Aug 2005)
Revision: 1451
Log message:
Reversed the declaration warning, more like Aleksey wanted it.
The is just short of what Aleksey suggested, but I think we want
to keep it like this. This generates a ton of messages, and I don't
think we want even more annotations.
Here is the rule. You get a warning if:
- you are defining a variable, say
X = ...
- and X is not already declared/defined in the current scope.
If you specify the variable class explicitly, the warning goes away.
The following case is fine:
open build/C
CFLAGS = -g
The following is a warning (and the new definition is different from
the one in build/C).
# Forgot to open build/C
CFLAGS = -g
The following is also fine. The public.CFLAGS refers to the current
file scope, so public.CFLAGS is different from C.CFLAGS.
open build/C
# No effect on C.CFLAGS
public.CFLAGS = hello world
# Explicitly specify C.CFLAGS
C.CFLAGS += -g