aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2014-11-10 20:14:41 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2014-11-10 20:14:41 +0000
commit13c216556de997e8bda737d18a41ebe61bce1d79 (patch)
treea319274155607b59e6fd0d9bad41edc6a68b2038 /gcc/c
parentde2b09ec2fac5fbbc0490f2768237f97261361ce (diff)
downloadgcc-13c216556de997e8bda737d18a41ebe61bce1d79.zip
gcc-13c216556de997e8bda737d18a41ebe61bce1d79.tar.gz
gcc-13c216556de997e8bda737d18a41ebe61bce1d79.tar.bz2
invoke.texi ([-Wshift-count-negative, [...]): Add.
2014-11-10 Paolo Carlini <paolo.carlini@oracle.com> * doc/invoke.texi ([-Wshift-count-negative, -Wshift-count-overflow]): Add. /c-family 2014-11-10 Paolo Carlini <paolo.carlini@oracle.com> * c.opt ([Wshift-count-negative, Wshift-count-overflow]): Add. /cp 2014-11-10 Paolo Carlini <paolo.carlini@oracle.com> * 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 <paolo.carlini@oracle.com> * 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 <paolo.carlini@oracle.com> * 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
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/ChangeLog5
-rw-r--r--gcc/c/c-typeck.c14
2 files changed, 13 insertions, 6 deletions
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 <paolo.carlini@oracle.com>
+
+ * c-typeck.c (build_binary_op): Use OPT_Wshift_count_negative and
+ OPT_Wshift_count_overflow in the warnings.
+
2014-10-30 Marek Polacek <polacek@redhat.com>
* c-objc-common.c (c_tree_printer) <case 'T'>: 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");
}
}