diff options
author | Zack Weinberg <zack@wolery.cumb.org> | 2000-05-26 01:29:35 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2000-05-26 01:29:35 +0000 |
commit | 476f28692a80a42632b33b7fb1f0725f81bdbce0 (patch) | |
tree | eb55a148a58f6d659d815694823130ccba0a2fc8 /gcc/cpplex.c | |
parent | 40aaba2b814b0495d3ef50ccb0b607484c0866e7 (diff) | |
download | gcc-476f28692a80a42632b33b7fb1f0725f81bdbce0.zip gcc-476f28692a80a42632b33b7fb1f0725f81bdbce0.tar.gz gcc-476f28692a80a42632b33b7fb1f0725f81bdbce0.tar.bz2 |
cpplex.c (maybe_macroexpand): Warn about function-like macros used in non-function context, if -Wtraditional.
* cpplex.c (maybe_macroexpand): Warn about function-like
macros used in non-function context, if -Wtraditional.
From-SVN: r34183
Diffstat (limited to 'gcc/cpplex.c')
-rw-r--r-- | gcc/cpplex.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/cpplex.c b/gcc/cpplex.c index b75db74..189333b 100644 --- a/gcc/cpplex.c +++ b/gcc/cpplex.c @@ -1687,6 +1687,12 @@ maybe_macroexpand (pfile, written) not_macro_call: if (macbuf_whitespace) CPP_PUTC (pfile, ' '); + + /* K+R treated this as a hard error. */ + if (CPP_OPTION (pfile, warn_traditional)) + cpp_warning (pfile, + "traditional C rejects function macro %s in non-function context", + hp->name); return 0; } } |