aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-typeck.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2005-05-24 23:59:00 -0400
committerDJ Delorie <dj@gcc.gnu.org>2005-05-24 23:59:00 -0400
commit44c21c7f0304a014f491b822f7eaea34f2cc4c3c (patch)
tree9643535c0dbab111233baa2e45e430fa4ca4774d /gcc/c-typeck.c
parent32a5d31dead6b6a3386cd8f792f3556b1f780b2d (diff)
downloadgcc-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-typeck.c')
-rw-r--r--gcc/c-typeck.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 1911ae5..00f7010 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -7523,8 +7523,8 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
case EXACT_DIV_EXPR:
/* Floating point division by zero is a legitimate way to obtain
infinities and NaNs. */
- if (warn_div_by_zero && skip_evaluation == 0 && integer_zerop (op1))
- warning (0, "division by zero");
+ if (skip_evaluation == 0 && integer_zerop (op1))
+ warning (OPT_Wdiv_by_zero, "division by zero");
if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE
|| code0 == COMPLEX_TYPE || code0 == VECTOR_TYPE)
@@ -7562,8 +7562,8 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
case TRUNC_MOD_EXPR:
case FLOOR_MOD_EXPR:
- if (warn_div_by_zero && skip_evaluation == 0 && integer_zerop (op1))
- warning (0, "division by zero");
+ if (skip_evaluation == 0 && integer_zerop (op1))
+ warning (OPT_Wdiv_by_zero, "division by zero");
if (code0 == INTEGER_TYPE && code1 == INTEGER_TYPE)
{
@@ -7655,8 +7655,9 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
case EQ_EXPR:
case NE_EXPR:
- if (warn_float_equal && (code0 == REAL_TYPE || code1 == REAL_TYPE))
- warning (0, "comparing floating point with == or != is unsafe");
+ if (code0 == REAL_TYPE || code1 == REAL_TYPE)
+ warning (OPT_Wfloat_equal,
+ "comparing floating point with == or != is unsafe");
/* Result of comparison is always int,
but don't convert the args to int! */
build_type = integer_type_node;