Bug 60351 - Incorrect column number for warning on "right shift count is negative"
Summary: Incorrect column number for warning on "right shift count is negative"
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.9.0
: P3 normal
Target Milestone: ---
Assignee: Marek Polacek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-27 00:11 UTC by Chengnian Sun
Modified: 2014-04-30 06:10 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2014-02-27 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chengnian Sun 2014-02-27 00:11:57 UTC
$: cat s.c 
void g(int);
void f(void) {
	int i = 1;
	g(      i>>-1);
}
$: gcc-trunk -c s.c 
s.c: In function ‘f’:
s.c:4:2: warning: right shift count is negative
  g(      i>>-1);
  ^
$:
Comment 1 Marek Polacek 2014-02-27 07:41:57 UTC
Mine.
Comment 2 Marek Polacek 2014-04-30 06:08:49 UTC
Author: mpolacek
Date: Wed Apr 30 06:08:17 2014
New Revision: 209925

URL: http://gcc.gnu.org/viewcvs?rev=209925&root=gcc&view=rev
Log:
	PR c/60351
	* c-typeck.c (build_binary_op): Use location when warning about
	shift count.

	* gcc.dg/pr60351.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/pr60351.c
Modified:
    trunk/gcc/c/ChangeLog
    trunk/gcc/c/c-typeck.c
    trunk/gcc/testsuite/ChangeLog
Comment 3 Marek Polacek 2014-04-30 06:10:13 UTC
Fixed.