From e964a55607b3cd9e45a45d3331c6f163df7519f5 Mon Sep 17 00:00:00 2001 From: Jason Thorpe Date: Sat, 18 May 2002 19:02:03 +0000 Subject: c-common.c (c_common_post_options): Warn if -Wformat-zero-length is used without -Wformat. * c-common.c (c_common_post_options): Warn if -Wformat-zero-length is used without -Wformat. * c-common.h (warn_format_zero_length): Declare extern. * c-decl.c (warn_options): Add "format-zero-length". * c-format.c (warn_format_zero_length): Declare. (set_Wformat): Set warn_format_zero_length for -Wformat. (check_format_info): Only warn about zero-length formats if warn_format_zero_length is true. Include the format type name in the warning message. * doc/invoke.texi: Document -Wformat-zero-length. * testsuite/gcc.dg/format/zero-length-1.c: New test. From-SVN: r53592 --- gcc/c-decl.c | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/c-decl.c') diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 854cd7309fd..8825db1653e 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -474,6 +474,7 @@ c_decode_option (argc, argv) { "div-by-zero", &warn_div_by_zero }, { "float-equal", &warn_float_equal }, { "format-extra-args", &warn_format_extra_args }, + { "format-zero-length", &warn_format_zero_length }, { "format-nonliteral", &warn_format_nonliteral }, { "format-security", &warn_format_security }, { "format-y2k", &warn_format_y2k }, -- cgit v1.2.1