diff options
author | DJ Delorie <dj@redhat.com> | 2005-05-24 23:59:00 -0400 |
---|---|---|
committer | DJ Delorie <dj@gcc.gnu.org> | 2005-05-24 23:59:00 -0400 |
commit | 44c21c7f0304a014f491b822f7eaea34f2cc4c3c (patch) | |
tree | 9643535c0dbab111233baa2e45e430fa4ca4774d /gcc/c-format.c | |
parent | 32a5d31dead6b6a3386cd8f792f3556b1f780b2d (diff) | |
download | gcc-44c21c7f0304a014f491b822f7eaea34f2cc4c3c.tar.gz |
c-common.c (unsigned_conversion_warning): Move warning control from if() to warning(OPT_*).
* c-common.c (unsigned_conversion_warning): Move warning control
from if() to warning(OPT_*).
(c_common_truthvalue_conversion): Likewise.
(c_do_switch_warnings): Likewise.
* c-decl.c (diagnose_mismatched_decls): Likewise.
(diagnose_mismatched_decls): Likewise.
(define_label): Likewise.
(grokdeclarator): Likewise.
* c-format.c (check_format_info): Likewise.
* c-lex.c (interpret_integer): Likwise.
(lex_string): Likewise.
* c-opts.c (c_common_post_options): Likewise.
* c-parser.c (c_parser_unary_expression): Likewise.
* c-pragma.c (handle_pragma_redefine_extname): Likewise.
(handle_pragma_extern_prefix): Likewise.
* c-typeck.c (build_binary_op): Likewise.
* gcse.c (is_too_expensive): Likewise.
* opts.c (decode_options): Likewise.
* stor-layout.c (place_field): Likewise.
* tree-cfg.c (remove_bb): Likewise.
* c.opt (-Wreturn-type): Add Var(warn_return_type).
* flags.h (warn_return_type): Remove.
* toplev.c (warn_return_type): Likewise.
From-SVN: r100135
Diffstat (limited to 'gcc/c-format.c')
-rw-r--r-- | gcc/c-format.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/gcc/c-format.c b/gcc/c-format.c index daa071e61ab..f413e39d411 100644 --- a/gcc/c-format.c +++ b/gcc/c-format.c @@ -1140,8 +1140,8 @@ check_format_info (function_format_info *info, tree params) { /* For strftime-like formats, warn for not checking the format string; but there are no arguments to check. */ - if (warn_format_nonliteral) - warning (0, "format not a string literal, format string not checked"); + warning (OPT_Wformat_nonliteral, + "format not a string literal, format string not checked"); } else if (info->first_arg_num != 0) { @@ -1154,10 +1154,15 @@ check_format_info (function_format_info *info, tree params) params = TREE_CHAIN (params); ++arg_num; } - if (params == 0 && (warn_format_nonliteral || warn_format_security)) - warning (0, "format not a string literal and no format arguments"); - else if (warn_format_nonliteral) - warning (0, "format not a string literal, argument types not checked"); + if (params == 0 && warn_format_security) + warning (OPT_Wformat_security, + "format not a string literal and no format arguments"); + else if (params == 0 && warn_format_nonliteral) + warning (OPT_Wformat_nonliteral, + "format not a string literal and no format arguments"); + else + warning (OPT_Wformat_nonliteral, + "format not a string literal, argument types not checked"); } } |