Commit 38e514c0 by Marek Polacek Committed by Marek Polacek

re PR c/60156 (GCC doesn't warn about variadic main)

	PR c/60156
	* c-common.c (check_main_parameter_types): Warn about variadic main.

	* c-c++-common/pr60156.c: New test.

From-SVN: r209787
parent e4012a04
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.
......
......@@ -2228,6 +2228,10 @@ check_main_parameter_types (tree decl)
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
......
/* PR c/60156 */
/* { dg-do compile } */
/* { dg-options "-Wpedantic" } */
int
main (int argc, char *argv[], ...) /* { dg-warning "declared as variadic function" } */
{
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment