From 13c216556de997e8bda737d18a41ebe61bce1d79 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Mon, 10 Nov 2014 20:14:41 +0000 Subject: invoke.texi ([-Wshift-count-negative, [...]): Add. 2014-11-10 Paolo Carlini * doc/invoke.texi ([-Wshift-count-negative, -Wshift-count-overflow]): Add. /c-family 2014-11-10 Paolo Carlini * c.opt ([Wshift-count-negative, Wshift-count-overflow]): Add. /cp 2014-11-10 Paolo Carlini * typeck.c (cp_build_binary_op): Use OPT_Wshift_count_negative and OPT_Wshift_count_overflow in the warnings. /c 2014-11-10 Paolo Carlini * c-typeck.c (build_binary_op): Use OPT_Wshift_count_negative and OPT_Wshift_count_overflow in the warnings. /testsuite 2014-11-10 Paolo Carlini * c-c++-common/Wshift-count-overflow-1.c: New. * c-c++-common/Wshift-count-overflow-2.c: Likewise. * c-c++-common/Wshift-count-negative-1.c: Likewise. * c-c++-common/Wshift-count-negative-2.c: Likewise. From-SVN: r217313 --- gcc/c/ChangeLog | 5 +++++ gcc/c/c-typeck.c | 14 ++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) (limited to 'gcc/c') diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 24781e1..a2b3c78 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,8 @@ +2014-11-10 Paolo Carlini + + * c-typeck.c (build_binary_op): Use OPT_Wshift_count_negative and + OPT_Wshift_count_overflow in the warnings. + 2014-10-30 Marek Polacek * c-objc-common.c (c_tree_printer) : For a typedef name, diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c index 79dbc3d..77ce549 100644 --- a/gcc/c/c-typeck.c +++ b/gcc/c/c-typeck.c @@ -10491,7 +10491,8 @@ build_binary_op (location_t location, enum tree_code code, { int_const = false; if (c_inhibit_evaluation_warnings == 0) - warning_at (location, 0, "right shift count is negative"); + warning_at (location, OPT_Wshift_count_negative, + "right shift count is negative"); } else { @@ -10502,8 +10503,8 @@ build_binary_op (location_t location, enum tree_code code, { int_const = false; if (c_inhibit_evaluation_warnings == 0) - warning_at (location, 0, "right shift count >= width " - "of type"); + warning_at (location, OPT_Wshift_count_overflow, + "right shift count >= width of type"); } } } @@ -10545,15 +10546,16 @@ build_binary_op (location_t location, enum tree_code code, { int_const = false; if (c_inhibit_evaluation_warnings == 0) - warning_at (location, 0, "left shift count is negative"); + warning_at (location, OPT_Wshift_count_negative, + "left shift count is negative"); } else if (compare_tree_int (op1, TYPE_PRECISION (type0)) >= 0) { int_const = false; if (c_inhibit_evaluation_warnings == 0) - warning_at (location, 0, "left shift count >= width of " - "type"); + warning_at (location, OPT_Wshift_count_overflow, + "left shift count >= width of type"); } } -- cgit v1.1