This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

glibc 2.2, libstdc++-v3 and -Werror


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)))));
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]