21-10-2016, 06:38 AM
Actually, both operands are promoted to unsigned int, so on a 32bit processor you compare 0x000000FFh with 0xFFFFFFFFh, which is always false:
(C99 6.8.4.2 Item 5 and 6.3.8.1).
Code:
19: switch (x)
0028140E movzx eax,byte ptr [_x (287138h)]
00281415 mov dword ptr [ebp-0C4h],eax
0028141B cmp dword ptr [ebp-0C4h],0FFFFFFFFh
00281422 je foo+36h (281426h)
00281424 jmp foo+4Dh (28143Dh)
(C99 6.8.4.2 Item 5 and 6.3.8.1).
<t></t>