diff options
author | Richard Henderson <rth@redhat.com> | 2004-02-19 14:18:50 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2004-02-19 14:18:50 -0800 |
commit | e5b792193379be3beab505f1a72fb4fedaf62e6b (patch) | |
tree | 9effadec8dda0ac6017abf144d9416979aa975a1 /gcc/c-opts.c | |
parent | 2df93cf3c4021f576c9381f6e25d9d847114f548 (diff) | |
download | gcc-e5b792193379be3beab505f1a72fb4fedaf62e6b.zip gcc-e5b792193379be3beab505f1a72fb4fedaf62e6b.tar.gz gcc-e5b792193379be3beab505f1a72fb4fedaf62e6b.tar.bz2 |
c-opts.c (warn_variadic_macros): New.
* 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.
From-SVN: r78125
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 a0d7382..c9b34db 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 |