aboutsummaryrefslogtreecommitdiff
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
parentWhen dropping all allocations, clear the freelist too (diff)
downloadsparse-89f32d3da8d281e826bf33c4c3efa7149654ea23.tar.gz
sparse-89f32d3da8d281e826bf33c4c3efa7149654ea23.tar.bz2
sparse-89f32d3da8d281e826bf33c4c3efa7149654ea23.zip
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 5def16f..898eab4 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);