aboutsummaryrefslogtreecommitdiff
path: root/gcc/cppmacro.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2004-02-19 14:18:50 -0800
committerRichard Henderson <rth@gcc.gnu.org>2004-02-19 14:18:50 -0800
commite5b792193379be3beab505f1a72fb4fedaf62e6b (patch)
tree9effadec8dda0ac6017abf144d9416979aa975a1 /gcc/cppmacro.c
parent2df93cf3c4021f576c9381f6e25d9d847114f548 (diff)
downloadgcc-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/cppmacro.c')
-rw-r--r--gcc/cppmacro.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/cppmacro.c b/gcc/cppmacro.c
index f4e8857..065c397 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");