aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/expression.c
diff options
authorAl Viro <viro@zeniv.linux.org.uk>2007-06-23 23:27:26 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2007-06-25 15:51:49 -0400
commit361908cf099b011f173a1ea3053f84eb8a08841e (patch)
tree1dba3c998ad17946733464206cd6704452a57bf0 /expression.c
parentf78588abcebac0462764e5c8a3c91fa7a13bad45 (diff)
downloadsparse-dev-361908cf099b011f173a1ea3053f84eb8a08841e.tar.gz
[PATCH] deal with enum members without excessive PITA
mark symbols for enum members, have primary_expression() copy their ->initializer instead of dancing through the EXRP_SYMBOL with expand_expression() finally getting to the damn thing. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'expression.c')
-rw-r--r--expression.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/expression.c b/expression.c
index cf076a9e..a40ab2bc 100644
--- a/expression.c
+++ b/expression.c
@@ -359,6 +359,13 @@ struct token *primary_expression(struct token *token, struct expression **tree)
token = builtin_types_compatible_p_expr(token, &expr);
break;
}
+ } else if (sym->enum_member) {
+ expr = alloc_expression(token->pos, EXPR_VALUE);
+ *expr = *sym->initializer;
+ /* we want the right position reported, thus the copy */
+ expr->pos = token->pos;
+ token = next;
+ break;
}
expr = alloc_expression(token->pos, EXPR_SYMBOL);