I've got the same result with VC++, LCC and DMC compiler so I assume it's
the correct behavior (I don't understand why).

Anyway, the reported bug is now fixed since my program correctly casts to
unsigned. Thanks for your time and your fix.

Christian

-----Original Message-----
From: tinycc-devel-bounces+eligis=wanadoo...@nongnu.org
[mailto:tinycc-devel-bounces+eligis=wanadoo...@nongnu.org] On Behalf Of
grischka
Sent: Tuesday, December 30, 2008 17:33
To: tinycc-devel@nongnu.org
Subject: Re: [Tinycc-devel] wrong preprocessor shift operation


Christian Jullien wrote:
> Many thanks, I tested your fix but I still have a broken case:
> 
> int
> main()
> {
>       unsigned int x = 0xffffffff;
>       unsigned int y = 1;
> 
>       printf("fixed %08x\n", x >> y);
>       printf("fixed %08x\n", (~(unsigned int)0) >> (unsigned int)1);
>       printf("fails %08x\n", (~0) >> 1);
> }
> 
> Christian

But for me results are the same with gcc and tcc

$ gcc test.c -o test && ./test
fixed 7fffffff
fixed 7fffffff
fails ffffffff
$ ./tcc -run test.c
fixed 7fffffff
fixed 7fffffff
fails ffffffff

Maybe gcc is not correct but then I need an exact explanation why ;)



_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/tinycc-devel
----------------------------------------------------------------------------
-----------
Orange vous informe que cet  e-mail a ete controle par l'anti-virus mail. 
Aucun virus connu a ce jour par nos services n'a ete detecte.







_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to