This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
glibc 2.2, libstdc++-v3 and -Werror
- To: gcc-bugs at gcc dot gnu dot org
- Subject: glibc 2.2, libstdc++-v3 and -Werror
- From: "H . J . Lu" <hjl at valinux dot com>
- Date: Sat, 1 Jul 2000 21:15:24 -0700
This is a code segment from glibc 2.2. gcc 2.96 gives:
# gcc -S x.cc
x.cc: In function `long unsigned int foo ()':
x.cc:4: warning: left shift count is negative
x.cc:4: warning: left shift count is negative
But libstdc++-v3 uses -Werror. I cannot compile libstdc++-v3 under
glibc 2.2 because of it. I don't know if gcc should warn the
unreachable code. It is a useless warning.
BTW, the code is taken from a macro expansion.
--
H.J. Lu (hjl@gnu.org)
--
unsigned long
foo ()
{
return ((0) < 8 ? (int) (1UL << ((0) + 24)) : ((0) < 16 ? (int) (1UL << ((0) + 8)) : ((0) < 24 ? (int) (1UL << ((0) - 8 )) : (int) (1UL << ((0) - 24)))));
}