I ran the following code below and got 2 different outputs depending on the architecture I ran it on.
On x86 I got 0xffffffff. Which is exactly what I'd expect. But on powerpc I got 0xff. Is casting really not portable? If so, what is the best way to deal with it?Code:int main() { char x = -1; int y = x; printf("0x%x\n", y); return 0; }