PR c/35436
* c-format.c (init_dynamic_gfc_info): Ignore invalid locus type.
* gcc.dg/format/gcc_gfc-2.c: New test.
From-SVN: r134408
+2008-04-17 Volker Reichelt <v.reichelt@netcologne.de>
+
+ PR c/35436
+ * c-format.c (init_dynamic_gfc_info): Ignore invalid locus type.
+
2008-04-08 Richard Guenther <rguenther@suse.de>
* fold-const.c (fold_widened_comparison): Do not allow
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;
+2008-04-17 Volker Reichelt <v.reichelt@netcologne.de>
+
+ PR c/35436
+ * gcc.dg/format/gcc_gfc-2.c: New test.
+
2008-04-08 Richard Guenther <rguenther@suse.de>
* gcc.c-torture/execute/20080408-1.c: New testcase.
--- /dev/null
+/* 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" } */
+}