On Wed Jan  2 04:07:28 EST 2013, [email protected] wrote:
> 0 < -0x80000000 == 1 with 5c.

i get the same results for all compilers:
        0 < -0x80000000......yes
        1 == -0x80000000......no
        0 < -0x80000000 == 1......yes

for [568]c.  the last one is correct since the order of operations are
        (0 < -0x80000000) == 1
which is clearly true.

- erik

#include <u.h>
#include <libc.h>

void
yesno(char *s, int bool)
{
        print("%s...", s);
        if(bool)
                print("yes\n");
        else
                print("no\n");
}
void
main(void)
{
        yesno("0 < -0x80000000...", 0 < -0x80000000);
        yesno("1 == -0x80000000...", 1 == -0x80000000);
        yesno("0 < -0x80000000 == 1...", 0 < -0x80000000 == 1);
        exits("");
}

Reply via email to