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/c-opts.c | |
parent | a712130ea5abd998619113f868af34d89fd3f3ca (diff) | |
download | gcc-05d51900dfa4ae5e5e8ed9c99a249cb22cf227c8.tar.gz |
* 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/c-opts.c')
-rw-r--r-- | gcc/c-opts.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/c-opts.c b/gcc/c-opts.c index a0d7382796f..c9b34db4921 100644 --- a/gcc/c-opts.c +++ b/gcc/c-opts.c @@ -88,6 +88,9 @@ static bool quote_chain_split; /* If -Wunused-macros. */ static bool warn_unused_macros; +/* If -Wvariadic-macros. */ +static bool warn_variadic_macros = true; + /* Number of deferred options. */ static size_t deferred_count; @@ -646,6 +649,10 @@ c_common_handle_option (size_t scode, const char *arg, int value) warn_unused_macros = value; break; + case OPT_Wvariadic_macros: + warn_variadic_macros = value; + break; + case OPT_Wwrite_strings: if (!c_dialect_cxx ()) flag_const_strings = value; @@ -1360,6 +1367,11 @@ sanitize_cpp_opts (void) cpp_opts->warn_long_long = warn_long_long && ((!flag_isoc99 && pedantic) || warn_traditional); + /* Similarly with -Wno-variadic-macros. No check for c99 here, since + this also turns off warnings about GCCs extension. */ + cpp_opts->warn_variadic_macros + = warn_variadic_macros && (pedantic || warn_traditional); + /* If we're generating preprocessor output, emit current directory if explicitly requested or if debugging information is enabled. ??? Maybe we should only do it for debugging formats that |