aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/expand.c
diff options
authorwelinder@troll.com <welinder@troll.com>2004-08-12 15:46:08 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:02:43 -0700
commitd8f1064cb3ec7d02ea95ceb3fa33a150433cd8e3 (patch)
tree46182ef574b85428369119f9c8543002d1cc583a /expand.c
parentcbac665ddaec668c423537d86b32c3c59d1fa03c (diff)
downloadsparse-dev-d8f1064cb3ec7d02ea95ceb3fa33a150433cd8e3.tar.gz
expand.c:
Don't complain over undefined preprocessor symbols that start with an underscore. This helps quiet a gazillion errors with _cplusplus and others used by solaris' system headers. This change may or may not be approapriate on a glibc system.
Diffstat (limited to 'expand.c')
-rw-r--r--expand.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/expand.c b/expand.c
index 1edd7d32..bfe91863 100644
--- a/expand.c
+++ b/expand.c
@@ -41,7 +41,9 @@ static int expand_symbol_expression(struct expression *expr)
* The preprocessor can cause unknown symbols to be generated
*/
if (!sym) {
- warn(expr->pos, "undefined preprocessor identifier '%s'", show_ident(expr->symbol_name));
+ const char *ident = show_ident(expr->symbol_name);
+ if (ident[0] != '_')
+ warn(expr->pos, "undefined preprocessor identifier '%s'", ident);
expr->type = EXPR_VALUE;
expr->value = 0;
return UNSAFE;