+2011-10-11 Tristan Gingold <gingold@adacore.com>
+
+ * doc/invoke.texi (C Dialect Options): Document
+ -fallow-parameterless-variadic-functions.
+ * c-parser.c (c_parser_parms_list_declarator): Handle it.
+
2011-10-10 Georg-Johann Lay <avr@gjlay.de>
* config/avr/avr.c (avr_option_override): Set
+2011-10-11 Tristan Gingold <gingold@adacore.com>
+
+ * c.opt: (fallow-parameterless-variadic-functions): New.
+
2011-09-08 Dodji Seketeli <dodji@redhat.com>
PR c++/33255 - Support -Wunused-local-typedefs warning
fall-virtual
C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
+fallow-parameterless-variadic-functions
+C ObjC Var(flag_allow_parameterless_variadic_functions)
+Allow variadic functions without named parameter
+
falt-external-templates
C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
No longer supported
if (c_parser_next_token_is (parser, CPP_ELLIPSIS))
{
struct c_arg_info *ret = build_arg_info ();
- /* Suppress -Wold-style-definition for this case. */
- ret->types = error_mark_node;
- error_at (c_parser_peek_token (parser)->location,
- "ISO C requires a named argument before %<...%>");
+
+ if (flag_allow_parameterless_variadic_functions)
+ {
+ /* F (...) is allowed. */
+ ret->types = NULL_TREE;
+ }
+ else
+ {
+ /* Suppress -Wold-style-definition for this case. */
+ ret->types = error_mark_node;
+ error_at (c_parser_peek_token (parser)->location,
+ "ISO C requires a named argument before %<...%>");
+ }
c_parser_consume_token (parser);
if (c_parser_next_token_is (parser, CPP_CLOSE_PAREN))
{
@item C Language Options
@xref{C Dialect Options,,Options Controlling C Dialect}.
@gccoptlist{-ansi -std=@var{standard} -fgnu89-inline @gol
--aux-info @var{filename} @gol
+-aux-info @var{filename} -fallow-parameterless-variadic-functions @gol
-fno-asm -fno-builtin -fno-builtin-@var{function} @gol
-fhosted -ffreestanding -fopenmp -fms-extensions -fplan9-extensions @gol
-trigraphs -no-integrated-cpp -traditional -traditional-cpp @gol
arguments followed by their declarations is also provided, inside
comments, after the declaration.
+@item -fallow-parameterless-variadic-functions
+Accept variadic functions without named parameters.
+
+Although it is possible to define such a function, this is not very
+useful as it is not possible to read the arguments. This is only
+supported for C as this construct is allowed by C++.
+
@item -fno-asm
@opindex fno-asm
Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
+2011-10-11 Tristan Gingold <gingold@adacore.com>
+
+ * gcc.dg/va-arg-4.c: New test.
+ * gcc.dg/va-arg-5.c: Ditto.
+
2011-10-11 Uros Bizjak <ubizjak@gmail.com>
* lib/target-supports.exp (check_effective_target_fd_truncate):
--- /dev/null
+/* { dg-do compile } */
+#include <stdarg.h>
+extern void baz(...); /* { dg-error "requires a named argument" } */
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-fallow-parameterless-variadic-functions" } */
+#include <stdarg.h>
+extern void baz(...);