From 476f28692a80a42632b33b7fb1f0725f81bdbce0 Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Fri, 26 May 2000 01:29:35 +0000 Subject: 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 --- gcc/cpplex.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gcc/cpplex.c') 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; } } -- cgit v1.1