mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-07 14:57:21 +08:00
cexp.y (warn_undef): New variable.
(exp): Optionally warn about undefined identifiers that evaluate to 0. From-SVN: r13877
This commit is contained in:
parent
10c1b9f689
commit
69375a37de
@ -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; }
|
||||
;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user