http://llvm.org/bugs/show_bug.cgi?id=9000
Douglas Gregor <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |[email protected] Resolution| |INVALID --- Comment #1 from Douglas Gregor <[email protected]> 2011-01-18 12:47:58 CST --- This is behaving correctly per C99 6.7.2.2p2, which allows the implementation to pick char or any signed or unsigned integer type as the underlying type. GCC and Clang pick "unsigned int" (which is fine), which ends up promoting to itself. In C++, it promotes to an int. See Clang's test/CodeGen/enum.c for a fun example where C and C++ produce different results because of the different promotion rules. Because of the (admittedly weird) behavior of C, this warning is not spurious: z really is treated as an unsigned value, and that can both be surprising and lead to bugs if the programmer doesn't understand it. -- Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug. _______________________________________________ LLVMbugs mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs
