This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC]: patch for PR c/22476 -Wmissing-format-attribute
- From: "Kaveh R. Ghazi" <ghazi at caipclassic dot rutgers dot edu>
- To: joseph at codesourcery dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 15 Jul 2005 09:26:00 -0400 (EDT)
- Subject: Re: [RFC]: patch for PR c/22476 -Wmissing-format-attribute
- References: <200507151316.j6FDG4AS006965@caipclassic.rutgers.edu>
> [...] However it fails to find the initialization case as expected
> in testcase miss-3.c in the patch below.
>
> For that testcase, GCC never calls 'convert_for_assignment'.
> Instead it leaves 'digest_init' through another clause and returns
> 'inside_init'. What I'm wondering is whether 'digest_init' needs
> an additional call to 'convert_for_assignment' on 'inside_init' in
> the relevant clause or if I have to duplicate the missing attribute
> detection code in that clause in 'digest_init'?
In case that wasn't clear, I mean this additional hunk. If I add this
in, the miss-3.c testcase yields the expected diagnostics. But I
don't know if this is correct in general.
Thanks,
--Kaveh
diff -rup orig/egcc-CVS20050714/gcc/c-typeck.c egcc-CVS20050714/gcc/c-typeck.c
--- orig/egcc-CVS20050714/gcc/c-typeck.c 2005-07-05 20:01:52.000000000 -0400
+++ egcc-CVS20050714/gcc/c-typeck.c 2005-07-15 09:13:47.854507882 -0400
@@ -4442,7 +4472,8 @@ digest_init (tree type, tree init, bool
inside_init = error_mark_node;
}
- return inside_init;
+ return convert_for_assignment (type, inside_init, ic_init, NULL_TREE,
+ NULL_TREE, 0);
}
/* Handle scalar types, including conversions. */