[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] wrong preprocessor shift operation

From: Christian Jullien
Subject: [Tinycc-devel] wrong preprocessor shift operation
Date: Sun, 28 Dec 2008 09:26:18 +0100

Hello team,


Simple code below is wrong, even when forcing to long or unsigned long :


            printf("%08x\n", ((~0) >> 1));

            printf("%08x\n", (unsigned long)((~(unsigned long)0) >> 1));

            printf("%08x\n", (long)((~(long)0) >> 1));


It prints


ffffffff while 7fffffff is expected.


Hope it helps to improve this nice little compiler.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]