diff options
| author | thorpej <thorpej@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-05-18 19:02:03 +0000 |
|---|---|---|
| committer | thorpej <thorpej@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-05-18 19:02:03 +0000 |
| commit | 959f435be90da086adecd9320cc25a9a2cd20a0b (patch) | |
| tree | c6b8df55dea21cfdbf9d6f73c35e548d165992b2 /gcc/c-common.c | |
| parent | 40570cc2420d0b37344c8a1835160d75eb2b5dcd (diff) | |
| download | ppe42-gcc-959f435be90da086adecd9320cc25a9a2cd20a0b.tar.gz ppe42-gcc-959f435be90da086adecd9320cc25a9a2cd20a0b.zip | |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53592 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-common.c')
| -rw-r--r-- | gcc/c-common.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c index 5a878991345..d851c27637b 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -4311,6 +4311,8 @@ c_common_post_options () warning ("-Wformat-y2k ignored without -Wformat"); if (warn_format_extra_args && !warn_format) warning ("-Wformat-extra-args ignored without -Wformat"); + if (warn_format_zero_length && !warn_format) + warning ("-Wformat-zero-length ignored without -Wformat"); if (warn_format_nonliteral && !warn_format) warning ("-Wformat-nonliteral ignored without -Wformat"); if (warn_format_security && !warn_format) |

