[RFC]: patch for PR c/22476 -Wmissing-format-attribute
Kaveh R. Ghazi
ghazi@caipclassic.rutgers.edu
Fri Jul 15 13:26:00 GMT 2005
> [...] 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. */
More information about the Gcc-patches
mailing list