diff options
author | Marek Polacek <polacek@redhat.com> | 2014-04-30 06:08:17 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2014-04-30 06:08:17 +0000 |
commit | c4bdc42f752a6fbff34c0bc75a907957afcbc431 (patch) | |
tree | 8fea5e3094a43d7d7e6859f382dc135b93e8d163 /gcc/c | |
parent | 171f2e787d4bc1d644acbede5eaf7641ff6a18d6 (diff) | |
download | gcc-c4bdc42f752a6fbff34c0bc75a907957afcbc431.zip gcc-c4bdc42f752a6fbff34c0bc75a907957afcbc431.tar.gz gcc-c4bdc42f752a6fbff34c0bc75a907957afcbc431.tar.bz2 |
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
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/c/c-typeck.c | 10 |
2 files changed, 12 insertions, 4 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 80841af..ee7c9be 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -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 diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c index 62c72df..e23c6db 100644 --- a/gcc/c/c-typeck.c +++ b/gcc/c/c-typeck.c @@ -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"); } } |