diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 2005-07-19 12:09:49 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 2005-07-19 12:09:49 +0000 |
commit | 7876a41423b46245f7eec641217c8330ded8734a (patch) | |
tree | dca43bd0a0db3df3cbcc88768c895067aa836aba /gcc/c-common.c | |
parent | 98ea74375f446196ce2ff7a3d5f7f9587b3ced52 (diff) | |
download | gcc-7876a41423b46245f7eec641217c8330ded8734a.zip gcc-7876a41423b46245f7eec641217c8330ded8734a.tar.gz gcc-7876a41423b46245f7eec641217c8330ded8734a.tar.bz2 |
re PR c++/22476 (-Wmissing-format-attribute should pick out function pointer candidates also)
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.
From-SVN: r102155
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r-- | gcc/c-common.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c index f7463e1..90a373c 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -5505,11 +5505,11 @@ check_function_arguments (tree attrs, tree params, tree typelist) /* Check for errors in format strings. */ - if (warn_format) - { + if (warn_format || warn_missing_format_attribute) check_function_format (attrs, params); - check_function_sentinel (attrs, params, typelist); - } + + if (warn_format) + check_function_sentinel (attrs, params, typelist); } /* Generic argument checking recursion routine. PARAM is the argument to |