Index: libcpp/macro.c =================================================================== --- libcpp/macro.c (revision 209800) +++ libcpp/macro.c (working copy) @@ -2794,14 +2794,12 @@ parse_params (cpp_reader *pfile, cpp_mac pfile->spec_nodes.n__VA_ARGS__); pfile->state.va_args_ok = 1; if (! CPP_OPTION (pfile, c99) - && CPP_OPTION (pfile, cpp_pedantic) && CPP_OPTION (pfile, warn_variadic_macros)) cpp_pedwarning (pfile, CPP_W_VARIADIC_MACROS, "anonymous variadic macros were introduced in C99"); } - else if (CPP_OPTION (pfile, cpp_pedantic) - && CPP_OPTION (pfile, warn_variadic_macros)) + else if (CPP_OPTION (pfile, warn_variadic_macros)) cpp_pedwarning (pfile, CPP_W_VARIADIC_MACROS, "ISO C does not permit named variadic macros"); Index: gcc/c-family/c-opts.c =================================================================== --- gcc/c-family/c-opts.c (revision 209800) +++ gcc/c-family/c-opts.c (working copy) @@ -396,6 +396,10 @@ c_common_handle_option (size_t scode, co cpp_opts->cpp_warn_long_long = value; break; + case OPT_Wvariadic_macros: + cpp_opts->warn_variadic_macros = value; + break; + case OPT_Wmissing_include_dirs: cpp_opts->warn_missing_include_dirs = value; break; @@ -1227,8 +1231,9 @@ sanitize_cpp_opts (void) /* Similarly with -Wno-variadic-macros. No check for c99 here, since this also turns off warnings about GCCs extension. */ - cpp_opts->warn_variadic_macros - = cpp_warn_variadic_macros && (pedantic || warn_traditional); + if (cpp_warn_variadic_macros == -1) + cpp_warn_variadic_macros = pedantic || warn_traditional; + cpp_opts->warn_variadic_macros = cpp_warn_variadic_macros; /* If we're generating preprocessor output, emit current directory if explicitly requested or if debugging information is enabled. Index: gcc/c-family/c.opt =================================================================== --- gcc/c-family/c.opt (revision 209800) +++ gcc/c-family/c.opt (working copy) @@ -509,6 +509,9 @@ Warn about missing fields in struct init Wsizeof-pointer-memaccess C ObjC C++ ObjC++ Var(warn_sizeof_pointer_memaccess) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall) +Wsizeof-array-argument +C Var(warn_sizeof_array_argument) Warning LangEnabledBy(C,Wall) + Wsuggest-attribute=format C ObjC C++ ObjC++ Var(warn_suggest_attribute_format) Warning Warn about functions which might be candidates for format attributes @@ -785,7 +788,7 @@ C ObjC C++ ObjC++ Var(warn_unused_result Warn if a caller of a function, marked with attribute warn_unused_result, does not use its return value Wvariadic-macros -C ObjC C++ ObjC++ Var(cpp_warn_variadic_macros) Init(1) Warning +C ObjC C++ ObjC++ Var(cpp_warn_variadic_macros) Init(-1) Warning Warn about using variadic macros Wvarargs Index: gcc/testsuite/gcc.dg/cpp/Wvariadic-5.c =================================================================== --- gcc/testsuite/gcc.dg/cpp/Wvariadic-5.c (revision 0) +++ gcc/testsuite/gcc.dg/cpp/Wvariadic-5.c (working copy) @@ -0,0 +1,6 @@ +/* { dg-do compile } */ +/* { dg-options "-std=iso9899:1990 -Wvariadic-macros" } */ + +#define f(x,...) /* { dg-warning "variadic" } */ +#define g(x,y...) /* { dg-warning "variadic" } */ +int not_empty;