Commit c69c9b36 by Joseph Myers Committed by Joseph Myers

re PR c/17301 (ICE on wrong usage of __builtin_stdarg_start)

	PR c/17301
	* builtins.c (expand_builtin_va_start): Check for too few
	arguments to va_start.

testsuite:
	* gcc.dg/pr17301-1.c: New test.

From-SVN: r88835
parent 216a5f1b
2004-10-10 Joseph S. Myers <jsm@polyomino.org.uk>
PR c/17301
* builtins.c (expand_builtin_va_start): Check for too few
arguments to va_start.
2004-10-10 Joseph S. Myers <jsm@polyomino.org.uk>
PR c/17189
* c-decl.c (grokfield): Make diagnostic for bad cases of unnamed
fields a pedwarn. Pedwarn here for unnamed structs/unions if
......
......@@ -3861,6 +3861,11 @@ expand_builtin_va_start (tree arglist)
chain = TREE_CHAIN (arglist);
if (!chain)
{
error ("too few arguments to function %<va_start%>");
return const0_rtx;
}
if (TREE_CHAIN (chain))
error ("too many arguments to function %<va_start%>");
......
2004-10-10 Joseph S. Myers <jsm@polyomino.org.uk>
PR c/17301
* gcc.dg/pr17301-1.c: New test.
2004-10-10 Joseph S. Myers <jsm@polyomino.org.uk>
PR c/17189
* gcc.dg/anon-struct-5.c: New test.
......
/* Invalid use of __builtin_stdarg_start should not cause an ICE. Bug
17301. */
/* { dg-do compile } */
/* { dg-options "" } */
int
write_format (char *format, ...)
{
__builtin_va_list p;
__builtin_stdarg_start (p); /* { dg-error "error: too few arguments to function 'va_start'" } */
}
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