tinycc-devel
[Top][All Lists]
Advanced

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

[Tinycc-devel] Small curiosity, re operator precedence.


From: Lostgallifreyan
Subject: [Tinycc-devel] Small curiosity, re operator precedence.
Date: Sat, 31 Mar 2012 09:47:56 +0100

Please ignore any 'unsafe' aspect this example might have, it IS bounded in the 
context I'm using it in....

while((*--o=*--i)!=92)

I was tryign to reduce stuff, so came up with this to try:

while(92!=*--o=*--i)

TCC loves it, GCC hates it. :)

GCC thinks it's doing this: while((92!=*--o)=*--i) and therefore an invalid 
lvalue, which makes sense given what Wikipedia has to say about precedence, but 
TCC (still using v0.9.24 here) seems to do what I was wondering if it might do, 
to compare the dereferenced value when it is copied. I reverted to the original 
form because the more compilers take my code the happier I am about it, but I'm 
interested. Is this a bug, or a feature? :)




reply via email to

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