diff options
author | reichelt <reichelt@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-04-01 20:33:37 +0000 |
---|---|---|
committer | reichelt <reichelt@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-04-01 20:33:37 +0000 |
commit | fa3b771a61c31955c58569a2827b83831e24ee15 (patch) | |
tree | 132c9feffc06431a45597cb1317e19073a9c2b8d /gcc | |
parent | dbec73a5931bce2bc421459f1c1291033fb6a553 (diff) | |
download | gcc-fa3b771a61c31955c58569a2827b83831e24ee15.tar.gz |
PR c/35436
* c-format.c (init_dynamic_gfc_info): Ignore invalid locus type.
* gcc.dg/format/gcc_gfc-2.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@133800 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/c-format.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/format/gcc_gfc-2.c | 13 |
4 files changed, 26 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f5c69d5c07a..651dd2a3a51 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2008-04-01 Volker Reichelt <v.reichelt@netcologne.de> + + PR c/35436 + * c-format.c (init_dynamic_gfc_info): Ignore invalid locus type. + 2008-04-02 Ben Elliston <bje@au.ibm.com> * config/v850/v850.md (casesi): Remove if (0) code. diff --git a/gcc/c-format.c b/gcc/c-format.c index 13de9106f3a..d1a136f87ec 100644 --- a/gcc/c-format.c +++ b/gcc/c-format.c @@ -2474,7 +2474,8 @@ init_dynamic_gfc_info (void) locus = identifier_global_value (locus); if (locus) { - if (TREE_CODE (locus) != TYPE_DECL) + if (TREE_CODE (locus) != TYPE_DECL + || TREE_TYPE (locus) == error_mark_node) { error ("%<locus%> is not defined as a type"); locus = 0; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8e9f51b84eb..5808d5cb4e2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,6 +1,11 @@ +2008-04-01 Volker Reichelt <v.reichelt@netcologne.de> + + PR c/35436 + * gcc.dg/format/gcc_gfc-2.c: New test. + 2008-03-31 Seongbae Park <seongbae.park@gmail.com> - * g++.db/bprob/bprob.exp: Do not check gcno files. + * g++.dg/bprob/bprob.exp: Do not check gcno files. Use -fprofile-use for profile use. * gcc.misc-tests/bprob.exp: Ditto. * g++.dg/tree-pro/tree-prof.exp: Do not check gcno files. diff --git a/gcc/testsuite/gcc.dg/format/gcc_gfc-2.c b/gcc/testsuite/gcc.dg/format/gcc_gfc-2.c new file mode 100644 index 00000000000..f3095fa296f --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/gcc_gfc-2.c @@ -0,0 +1,13 @@ +/* PR c/35436 */ +/* { dg-do compile } */ +/* { dg-options "-Wformat" } */ + +typedef void locus[1]; /* { dg-error "array of void" } */ + +void foo(const char*, ...) + __attribute__((__format__(__gcc_gfc__, 1, 2))); /* { dg-error "locus" } */ + +void bar() +{ + foo("%L", 0); /* { dg-warning "format" } */ +} |