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-common.c | |
parent | 32a5d31dead6b6a3386cd8f792f3556b1f780b2d (diff) | |
download | gcc-44c21c7f0304a014f491b822f7eaea34f2cc4c3c.zip gcc-44c21c7f0304a014f491b822f7eaea34f2cc4c3c.tar.gz gcc-44c21c7f0304a014f491b822f7eaea34f2cc4c3c.tar.bz2 |
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-common.c')
-rw-r--r-- | gcc/c-common.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c index c902746..17efd33 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -945,8 +945,9 @@ unsigned_conversion_warning (tree result, tree operand) if (!int_fits_type_p (operand, c_common_signed_type (type))) /* This detects cases like converting -129 or 256 to unsigned char. */ warning (0, "large integer implicitly truncated to unsigned type"); - else if (warn_conversion) - warning (0, "negative integer implicitly converted to unsigned type"); + else + warning (OPT_Wconversion, + "negative integer implicitly converted to unsigned type"); } } @@ -2470,8 +2471,9 @@ c_common_truthvalue_conversion (tree expr) break; case MODIFY_EXPR: - if (warn_parentheses && !TREE_NO_WARNING (expr)) - warning (0, "suggest parentheses around assignment used as truth value"); + if (!TREE_NO_WARNING (expr)) + warning (OPT_Wparentheses, + "suggest parentheses around assignment used as truth value"); break; default: @@ -3725,8 +3727,9 @@ c_do_switch_warnings (splay_tree cases, location_t switch_location, return; default_node = splay_tree_lookup (cases, (splay_tree_key) NULL); - if (warn_switch_default && !default_node) - warning (0, "%Hswitch missing default case", &switch_location); + if (!default_node) + warning (OPT_Wswitch_default, "%Hswitch missing default case", + &switch_location); /* If the switch expression was an enumerated type, check that exactly all enumeration literals are covered by the cases. |