re PR c/60351 (Incorrect column number for warning on "right shift count is negative")
PR c/60351 * c-typeck.c (build_binary_op): Use location when warning about shift count. * gcc.dg/pr60351.c: New test. From-SVN: r209925
This commit is contained in:
parent
171f2e787d
commit
c4bdc42f75
4 changed files with 28 additions and 4 deletions
|
@ -1,3 +1,9 @@
|
|||
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
|
||||
|
|
|
@ -10402,7 +10402,7 @@ build_binary_op (location_t location, enum tree_code code,
|
|||
{
|
||||
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
|
||||
{
|
||||
|
@ -10413,7 +10413,8 @@ build_binary_op (location_t location, enum tree_code code,
|
|||
{
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10455,14 +10456,15 @@ build_binary_op (location_t location, enum tree_code code,
|
|||
{
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
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.
|
||||
|
|
11
gcc/testsuite/gcc.dg/pr60351.c
Normal file
11
gcc/testsuite/gcc.dg/pr60351.c
Normal file
|
@ -0,0 +1,11 @@
|
|||
/* 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" } */
|
||||
}
|
Loading…
Add table
Reference in a new issue