http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48418
--- Comment #2 from Dmitry Gorbachev <d.g.gorbachev at gmail dot com>
2011-04-02 21:43:15 UTC ---
GCC 4.x regression, for x >= 5:
$ cat > foo.c
unsigned foo(void)
{
#ifdef CONST
const
#endif
unsigned i = sizeof(unsigned) << 3;
unsigned x = 1000;
return x >> i;
}
^D
$ gcc-4.5.0 -O -S foo.c -DCONST
$ gcc-4.4.6 -O -S foo.c -DCONST
foo.c: In function 'foo':
foo.c:8: warning: right shift count >= width of type
g++ works.
