+2014-04-30 Marek Polacek <polacek@redhat.com>
+
+ PR c/60351
+ * c-typeck.c (build_binary_op): Use location when warning about
+ shift count.
+
2014-04-25 Marek Polacek <polacek@redhat.com>
PR c/18079
{
int_const = false;
if (c_inhibit_evaluation_warnings == 0)
- warning (0, "right shift count is negative");
+ warning_at (location, 0, "right shift count is negative");
}
else
{
{
int_const = false;
if (c_inhibit_evaluation_warnings == 0)
- warning (0, "right shift count >= width of type");
+ warning_at (location, 0, "right shift count >= width "
+ "of type");
}
}
}
{
int_const = false;
if (c_inhibit_evaluation_warnings == 0)
- warning (0, "left shift count is negative");
+ warning_at (location, 0, "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 (0, "left shift count >= width of type");
+ warning_at (location, 0, "left shift count >= width of "
+ "type");
}
}
+2014-04-30 Marek Polacek <polacek@redhat.com>
+
+ PR c/60351
+ * gcc.dg/pr60351.c: New test.
+
2013-04-29 Alan Lawrence <alan.lawrence@arm.com>
* gcc.target/arm/simd/simd.exp: New file.
--- /dev/null
+/* PR c/60351 */
+/* { dg-do compile } */
+
+void
+f (int i)
+{
+ i >> -1; /* { dg-warning "5:right shift count is negative" } */
+ i >> 250; /* { dg-warning "5:right shift count >= width of type" } */
+ i << -1; /* { dg-warning "5:left shift count is negative" } */
+ i << 250; /* { dg-warning "5:left shift count >= width of type" } */
+}