[PATCH]: PR c/22476 -Wmissing-format-attribute [take 2]

Joseph S. Myers joseph@codesourcery.com
Sat Jul 16 14:14:00 GMT 2005


On Sat, 16 Jul 2005, Kaveh R. Ghazi wrote:

> 	PR c/22476
> 	* c-typeck.c (convert_for_assignment): Detect additional cases for
> 	-Wmissing-format-attribute.
> 	(digest_init): Call 'convert_for_assignment' before returning.
> 	* doc/invoke.texi (-Wmissing-format-attribute): Document new
> 	behavior.
> 
> cp:
> 	* call.c (diagnostic_fn_t): New.
> 	(build_temp, convert_like_real): Use diagnostic_fn_t.
> 
> testsuite:
> 	* gcc.dg/format/miss-3.c, gcc.dg/format/miss-4.c,
> 	gcc.dg/format/miss-5.c, gcc.dg/format/miss-6.c: New.

The warning in c_common_post_options for -Wmissing-format-attribute 
without -Wformat will need rewording, and "warning (0," in the patch 
should use OPT_Wmissing_format_attribute instead of 0.

The digest_init change is OK for mainline (I think it will also help in 
fixing other bugs to have such initializations pass through 
convert_for_assignment).  The C++ front end changes to add extra 
attributes are probably OK but it's not for me to approve them.  The 
remaining changes to add the new feature (with the changes I mention 
above) are OK for 4.2 but it's the RM's call for 4.1.

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    joseph@codesourcery.com (CodeSourcery mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)



More information about the Gcc-patches mailing list