diff options
author | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-07-19 12:09:49 +0000 |
---|---|---|
committer | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-07-19 12:09:49 +0000 |
commit | 95c90e04ee6d5268b0897fbbbf56d5757c035838 (patch) | |
tree | dca43bd0a0db3df3cbcc88768c895067aa836aba /gcc/c-format.c | |
parent | 9bf217119bd804a84f8bde2298a35d776f36147f (diff) | |
download | gcc-95c90e04ee6d5268b0897fbbbf56d5757c035838.tar.gz |
PR c/22476
* c-common.c (check_function_arguments): Call
'check_function_format' if either -Wformat or
-Wmissing-format-attribute are specified.
* c-format.c (check_function_format): Check -Wformat before
calling 'check_format_info'.
* c-opts.c (c_common_post_options): Don't warn for
-Wmissing-format-attribute without -Wformat.
* c-typeck.c (convert_for_assignment): Detect additional cases for
-Wmissing-format-attribute.
* doc/invoke.texi (-Wmissing-format-attribute): Document new
behavior.
testsuite:
* gcc.dg/format/miss-1.c, gcc.dg/format/miss-2.c: Don't
specify -Wformat for these tests.
* 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.
* gcc.dg/format/opt-6.c: Delete.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@102155 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-format.c')
-rw-r--r-- | gcc/c-format.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/c-format.c b/gcc/c-format.c index 10a5f21db59..587f15e9c6b 100644 --- a/gcc/c-format.c +++ b/gcc/c-format.c @@ -864,7 +864,8 @@ check_function_format (tree attrs, tree params) /* Yup; check it. */ function_format_info info; decode_format_attr (TREE_VALUE (a), &info, 1); - check_format_info (&info, params); + if (warn_format) + check_format_info (&info, params); if (warn_missing_format_attribute && info.first_arg_num == 0 && (format_types[info.format_type].flags & (int) FMT_FLAG_ARG_CONVERT)) |