diff options
author | dsh <dsh@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-08-13 21:55:01 +0000 |
---|---|---|
committer | dsh <dsh@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-08-13 21:55:01 +0000 |
commit | 7b3a7c6b89ac691b48179dcdf7a7ea44fec22afd (patch) | |
tree | 278e6dbd480b49a8489a8b858c2faeb7bea5386b /gcc/testsuite/gcc.dg/format | |
parent | eb4a5c3e8794a4ce13f4e85730765f62ab35d4fb (diff) | |
download | gcc-7b3a7c6b89ac691b48179dcdf7a7ea44fec22afd.tar.gz |
gcc/
2007-08-3 1 Dan Hipschman <dsh@google.com>
PR 32953
* c-format.c (check_format_arg): Move check for zero-length
format strings below the check for unterminated strings.
testsuite/
2007-08-13 Dan Hipschman <dsh@google.com>
PR 32953
* gcc.dg/format/array-1.c: Add an additional test for
unterminated format strings of length 1.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127399 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/format')
-rw-r--r-- | gcc/testsuite/gcc.dg/format/array-1.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/testsuite/gcc.dg/format/array-1.c b/gcc/testsuite/gcc.dg/format/array-1.c index fa27abe1dee..14db56e03ab 100644 --- a/gcc/testsuite/gcc.dg/format/array-1.c +++ b/gcc/testsuite/gcc.dg/format/array-1.c @@ -7,7 +7,8 @@ const char a1[] = "foo"; const char a2[] = "foo%d"; -const char b[3] = "foo"; +const char b1[3] = "foo"; +const char b2[1] = "1"; static const char c1[] = "foo"; static const char c2[] = "foo%d"; char d[] = "foo"; @@ -23,7 +24,8 @@ foo (int i, long l) printf (a1); printf (a2, i); printf (a2, l); /* { dg-warning "format" "wrong type with array" } */ - printf (b); /* { dg-warning "unterminated" "unterminated array" } */ + printf (b1); /* { dg-warning "unterminated" "unterminated array" } */ + printf (b2); /* { dg-warning "unterminated" "unterminated array" } */ printf (c1); printf (c2, i); printf (c2, l); /* { dg-warning "format" "wrong type with array" } */ |