diff options
author | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-06-26 21:54:24 +0000 |
---|---|---|
committer | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-06-26 21:54:24 +0000 |
commit | 5f168e43d4e01972a25012b0fe884a05aa856f5a (patch) | |
tree | 41908d1e14fb3ba4c882eacbba3fca4d4f164007 /gcc/testsuite/gcc.dg/format | |
parent | a0b604fc7f2dfaba292640b7669f283094a5c74c (diff) | |
download | gcc-5f168e43d4e01972a25012b0fe884a05aa856f5a.tar.gz |
PR c/21911
* c-common.c (check_function_sentinel): Pass in named argument
list, skip over named arguments before looking for a sentinel.
(check_function_arguments): Pass in named argument list.
* c-common.h (check_function_arguments): Likewise.
* c-typeck.c (build_function_call): Likewise.
cp:
* call.c (build_over_call): Pass in named argument list to
`check_function_arguments'.
* typeck.c (build_function_call): Likewise.
testsuite:
PR c/21911
* gcc.dg/format/sentinel-1.c: Update. Fix execl* calls.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101341 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/format')
-rw-r--r-- | gcc/testsuite/gcc.dg/format/sentinel-1.c | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/gcc/testsuite/gcc.dg/format/sentinel-1.c b/gcc/testsuite/gcc.dg/format/sentinel-1.c index 12915b7dc5a..1dc090870e4 100644 --- a/gcc/testsuite/gcc.dg/format/sentinel-1.c +++ b/gcc/testsuite/gcc.dg/format/sentinel-1.c @@ -27,40 +27,47 @@ extern void foo10 (const char *, ...) __attribute__ ((__sentinel__(1,3))); /* { extern void bar(void) { - foo1 (); /* { dg-error "missing sentinel|too few arguments" "sentinel" } */ - foo1 ("a"); /* { dg-warning "missing sentinel" "sentinel" } */ + foo1 (); /* { dg-error "not enough|too few arguments" "sentinel" } */ + foo1 (NULL); /* { dg-warning "not enough" "sentinel" } */ + foo1 ("a"); /* { dg-warning "not enough" "sentinel" } */ foo1 ("a", 1); /* { dg-warning "missing sentinel" "sentinel" } */ foo1 ("a", 0); /* { dg-warning "missing sentinel" "sentinel" } */ foo1 ("a", (void*)1); /* { dg-warning "missing sentinel" "sentinel" } */ foo1 ("a", NULL, 1); /* { dg-warning "missing sentinel" "sentinel" } */ foo1 ("a", NULL); + foo5 (NULL); /* { dg-warning "not enough" "sentinel" } */ + foo5 (NULL, 1); /* { dg-warning "not enough" "sentinel" } */ + foo5 ("a", NULL); /* { dg-warning "not enough" "sentinel" } */ + foo5 ("a", NULL, 1); foo5 ("a", 1, 2, 3, NULL); /* { dg-warning "missing sentinel" "sentinel" } */ foo5 ("a", 1, 2, NULL, 3); foo5 ("a", 1, NULL, 2, 3); /* { dg-warning "missing sentinel" "sentinel" } */ foo5 ("a", NULL, 1, 2, 3); /* { dg-warning "missing sentinel" "sentinel" } */ foo5 ("a", 0, 1, 2, 3); /* { dg-warning "missing sentinel" "sentinel" } */ - foo6 ("a", 1, NULL); /* { dg-warning "not enough arguments" "sentinel" } */ - foo6 ("a", 1, NULL, 2); /* { dg-warning "not enough arguments" "sentinel" } */ - foo6 ("a", 1, NULL, 2, 3); /* { dg-warning "not enough arguments" "sentinel" } */ - foo6 ("a", NULL, 1, 2, 3); /* { dg-warning "not enough arguments" "sentinel" } */ - foo6 ("a", NULL, 1, 2, 3, 4); /* { dg-warning "missing sentinel" "sentinel" } */ + foo6 ("a", 1, NULL); /* { dg-warning "not enough" "sentinel" } */ + foo6 ("a", 1, NULL, 2); /* { dg-warning "not enough" "sentinel" } */ + foo6 ("a", 1, NULL, 2, 3); /* { dg-warning "not enough" "sentinel" } */ + foo6 ("a", NULL, 1, 2, 3); /* { dg-warning "not enough" "sentinel" } */ + foo6 ("a", NULL, 1, 2, 3, 4); /* { dg-warning "not enough" "sentinel" } */ + foo6 (NULL, 1, 2, 3, 4, 5); /* { dg-warning "not enough" "sentinel" } */ foo6 ("a", NULL, 1, 2, 3, 4, 5); + foo6 ("a", 0, NULL, 1, 2, 3, 4, 5); foo6 ("a", 0, 1, 2, 3, 4, 5); /* { dg-warning "missing sentinel" "sentinel" } */ foo6 ("a", NULL, 1, 2, 3, 4, 5, 6); /* { dg-warning "missing sentinel" "sentinel" } */ foo7 ("a", 1, 2, 3, NULL); - execl ("/bin/ls", "-aFC"); /* { dg-warning "missing sentinel" "sentinel" } */ - execl ("/bin/ls", "-aFC", 0); /* { dg-warning "missing sentinel" "sentinel" } */ - execl ("/bin/ls", "-aFC", NULL); + execl ("/bin/ls", "/bin/ls", "-aFC"); /* { dg-warning "missing sentinel" "sentinel" } */ + execl ("/bin/ls", "/bin/ls", "-aFC", 0); /* { dg-warning "missing sentinel" "sentinel" } */ + execl ("/bin/ls", "/bin/ls", "-aFC", NULL); - execlp ("ls", "-aFC"); /* { dg-warning "missing sentinel" "sentinel" } */ - execlp ("ls", "-aFC", 0); /* { dg-warning "missing sentinel" "sentinel" } */ - execlp ("ls", "-aFC", NULL); + execlp ("ls", "ls", "-aFC"); /* { dg-warning "missing sentinel" "sentinel" } */ + execlp ("ls", "ls", "-aFC", 0); /* { dg-warning "missing sentinel" "sentinel" } */ + execlp ("ls", "ls", "-aFC", NULL); - execle ("ls", "-aFC", ".", envp); /* { dg-warning "missing sentinel" "sentinel" } */ - execle ("ls", "-aFC", ".", 0, envp); /* { dg-warning "missing sentinel" "sentinel" } */ - execle ("ls", "-aFC", ".", NULL, envp); + execle ("ls", "ls", "-aFC", ".", envp); /* { dg-warning "missing sentinel" "sentinel" } */ + execle ("ls", "ls", "-aFC", ".", 0, envp); /* { dg-warning "missing sentinel" "sentinel" } */ + execle ("ls", "ls", "-aFC", ".", NULL, envp); } |