aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Viro <viro@parcelfarce.linux.theplanet.co.uk>2004-09-30 09:17:10 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:03:25 -0700
commite3f66d29bd11094bcb0783148989fada4f3dfe60 (patch)
tree3f2841f24300edae6ad417b60fd0f919e4343d1c /expand.c
parent[PATCH] enum handling (diff)
downloadsparse-e3f66d29bd11094bcb0783148989fada4f3dfe60.tar.gz
sparse-e3f66d29bd11094bcb0783148989fada4f3dfe60.tar.bz2
sparse-e3f66d29bd11094bcb0783148989fada4f3dfe60.zip
[PATCH] #if expression handling cleanups
- handling of "unexpanded identifiers should be replaced with 0" is moved to pre-process.c and done on token replacement level - warning about such replacement made conditional - expand() and expand_one_symbol() return int now - it's "is the first token completely expanded now" (simplifies the life in #if handling, etc.) - crud removed from evaluate.c and expand.c
Diffstat (limited to 'expand.c')
-rw-r--r--expand.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/expand.c b/expand.c
index 99efb94..c02a238 100644
--- a/expand.c
+++ b/expand.c
@@ -37,17 +37,6 @@ static int expand_statement(struct statement *);
static int expand_symbol_expression(struct expression *expr)
{
struct symbol *sym = expr->symbol;
-
- /*
- * The preprocessor can cause unknown symbols to be generated
- */
- if (!sym) {
- warning(expr->pos, "undefined preprocessor identifier '%s'", show_ident(expr->symbol_name));
- expr->type = EXPR_VALUE;
- expr->value = 0;
- return UNSAFE;
- }
-
/* The cost of a symbol expression is lower for on-stack symbols */
return (sym->ctype.modifiers & (MOD_STATIC | MOD_EXTERN)) ? 2 : 1;
}