PR c/60156
* c-common.c (check_main_parameter_types): Warn about variadic main.
* c-c++-common/pr60156.c: New test.
From-SVN: r209787
+2014-04-25 Marek Polacek <polacek@redhat.com>
+
+ PR c/60156
+ * c-common.c (check_main_parameter_types): Warn about variadic main.
+
2014-04-24 Mike Stump <mikestump@comcast.net>
* c.opt (Wshadow-ivar): Default to on.
if (argct > 0 && (argct < 2 || argct > 3))
pedwarn (input_location, OPT_Wmain,
"%q+D takes only zero or two arguments", decl);
+
+ if (stdarg_p (TREE_TYPE (decl)))
+ pedwarn (input_location, OPT_Wmain,
+ "%q+D declared as variadic function", decl);
}
/* vector_targets_convertible_p is used for vector pointer types. The
+2014-04-25 Marek Polacek <polacek@redhat.com>
+
+ PR c/60156
+ * c-c++-common/pr60156.c: New test.
+
2014-04-25 Richard Biener <rguenther@suse.de>
PR ipa/60912
--- /dev/null
+/* PR c/60156 */
+/* { dg-do compile } */
+/* { dg-options "-Wpedantic" } */
+
+int
+main (int argc, char *argv[], ...) /* { dg-warning "declared as variadic function" } */
+{
+ return 0;
+}