aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@penguin.transmeta.com>2003-05-30 15:57:15 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:00:47 -0700
commit9f7a0188911742338e46a70596cab830b3ef3131 (patch)
treefff026b1c18fbc851198ffc3297277564e8d2346
parent78bdeb55cf57ed0e181ee69c2ae843b55f67b01e (diff)
downloadsparse-9f7a0188911742338e46a70596cab830b3ef3131.tar.gz
sparse-9f7a0188911742338e46a70596cab830b3ef3131.tar.xz
sparse-9f7a0188911742338e46a70596cab830b3ef3131.zip
Don't try to give typdefs storage bits.
-rw-r--r--parse.c7
-rw-r--r--symbol.c2
2 files changed, 8 insertions, 1 deletions
diff --git a/parse.c b/parse.c
index c582b8b..c570a8a 100644
--- a/parse.c
+++ b/parse.c
@@ -1017,6 +1017,13 @@ static struct token *external_declaration(struct token *token, struct symbol_lis
/* type define declaration? */
is_typedef = (ctype.modifiers & MOD_TYPEDEF) != 0;
+
+ /* Typedef's don't have meaningful storage */
+ if (is_typedef) {
+ ctype.modifiers &= ~MOD_STORAGE;
+ decl->ctype.modifiers &= ~MOD_STORAGE;
+ }
+
bind_symbol(decl, ident, is_typedef ? NS_TYPEDEF: NS_SYMBOL);
base_type = decl->ctype.base_type;
diff --git a/symbol.c b/symbol.c
index 77d0ee4..84f299b 100644
--- a/symbol.c
+++ b/symbol.c
@@ -310,7 +310,7 @@ void bind_symbol(struct symbol *sym, struct ident *ident, enum namespace ns)
sym->id_list = &ident->symbols;
scope = block_scope;
- if (toplevel(scope)) {
+ if (ns != NS_TYPEDEF && toplevel(scope)) {
sym->ctype.modifiers |= MOD_TOPLEVEL;
if (sym->ctype.modifiers & MOD_STATIC)
scope = file_scope;