aboutsummaryrefslogtreecommitdiffstats
path: root/symbol.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-08-02 17:23:23 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-08-02 17:23:23 -0700
commit89f32d3da8d281e826bf33c4c3efa7149654ea23 (patch)
treebf1cec49fa15e87f307dedb4c893b2f7c2f9b550 /symbol.c
parentd2b60d1311f15ebf45eff760e4815b009f6c1367 (diff)
downloadsparse-89f32d3da8d281e826bf33c4c3efa7149654ea23.tar.gz
Make macros have file scope
Also, macros are special: they can be removed out of scope with #undef, which makes them slightly more interesting when we exit the scope.
Diffstat (limited to 'symbol.c')
-rw-r--r--symbol.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/symbol.c b/symbol.c
index 5def16f5..898eab4a 100644
--- a/symbol.c
+++ b/symbol.c
@@ -469,6 +469,8 @@ void bind_symbol(struct symbol *sym, struct ident *ident, enum namespace ns)
else
sym->ctype.modifiers |= MOD_ADDRESSABLE;
}
+ if (ns == NS_MACRO)
+ scope = file_scope;
if (ns == NS_LABEL)
scope = function_scope;
bind_scope(sym, scope);