summaryrefslogtreecommitdiff
path: root/gcc/cexp.y
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cexp.y')
-rw-r--r--gcc/cexp.y8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cexp.y b/gcc/cexp.y
index 2d2d34f8b28..133539f6c5d 100644
--- a/gcc/cexp.y
+++ b/gcc/cexp.y
@@ -164,6 +164,9 @@ extern int traditional;
/* Flag for -lang-c89. */
extern int c89;
+/* Flag for -Wundef. */
+extern int warn_undef;
+
#ifndef CHAR_TYPE_SIZE
#define CHAR_TYPE_SIZE BITS_PER_UNIT
#endif
@@ -445,7 +448,10 @@ exp : exp '*' exp
| CHAR
{ $$ = yylval.integer; }
| NAME
- { $$.value = 0;
+ { if (warn_undef && !skip_evaluation)
+ warning ("`%.*s' is not defined",
+ $1.length, $1.address);
+ $$.value = 0;
$$.signedp = SIGNED; }
;