diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-02-19 22:18:50 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-02-19 22:18:50 +0000 |
commit | 05d51900dfa4ae5e5e8ed9c99a249cb22cf227c8 (patch) | |
tree | 9effadec8dda0ac6017abf144d9416979aa975a1 /gcc/cppmacro.c | |
parent | a712130ea5abd998619113f868af34d89fd3f3ca (diff) | |
download | ppe42-gcc-05d51900dfa4ae5e5e8ed9c99a249cb22cf227c8.tar.gz ppe42-gcc-05d51900dfa4ae5e5e8ed9c99a249cb22cf227c8.zip |
* c-opts.c (warn_variadic_macros): New.
(c_common_handle_option): Set it.
(sanitize_cpp_opts): Copy it to cpp_opts.
* c.opt (Wvariadic-macros): New.
* cpplib.h (struct cpp_options): Add warn_variadic_macros.
* cppinit.c (cpp_create_reader): Initialize it.
* cppmacro.c (parse_params): Check it.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@78125 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cppmacro.c')
-rw-r--r-- | gcc/cppmacro.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/cppmacro.c b/gcc/cppmacro.c index f4e885740b4..065c3972016 100644 --- a/gcc/cppmacro.c +++ b/gcc/cppmacro.c @@ -1327,11 +1327,14 @@ parse_params (cpp_reader *pfile, cpp_macro *macro) _cpp_save_parameter (pfile, macro, pfile->spec_nodes.n__VA_ARGS__); pfile->state.va_args_ok = 1; - if (! CPP_OPTION (pfile, c99) && CPP_OPTION (pfile, pedantic)) + if (! CPP_OPTION (pfile, c99) + && CPP_OPTION (pfile, pedantic) + && CPP_OPTION (pfile, warn_variadic_macros)) cpp_error (pfile, CPP_DL_PEDWARN, "anonymous variadic macros were introduced in C99"); } - else if (CPP_OPTION (pfile, pedantic)) + else if (CPP_OPTION (pfile, pedantic) + && CPP_OPTION (pfile, warn_variadic_macros)) cpp_error (pfile, CPP_DL_PEDWARN, "ISO C does not permit named variadic macros"); |