https://llvm.org/bugs/show_bug.cgi?id=22253
Chengnian Sun <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|INVALID |--- --- Comment #5 from Chengnian Sun <[email protected]> --- (In reply to comment #3) > (In reply to comment #2) > > Is clang really wrong here? > > There's no guarantte that a is zero if I recall correctly the C standard. > > Can you elaborate more why the expression "(unsigned char)(a << 8)" is NOT > zero? > > Thanks. I did not see any undefined behavior here. The expression 'a << 8' will yield a value of which the lowest 8 bits are 0. The cast from int to unsigned char will only keep the lowest 8 bits. Please correct me if I am wrong. Thanks. -- 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
