"Arnaud Bergeron" <[EMAIL PROTECTED]> writes:

> mt-daapd suffers from a case I've named 0.5:
>
> pointer -> int
>
> and then the int is used as a truth value.  So this is not a bug.

Not a bug? Really?

$ cat foo.c
int
main()
{
        int true;
        void *nonnull = (void *)0x7000000000000000;

        true = nonnull;
        printf(true ? "true\n" : "false\n");
        true = !!nonnull;
        printf(true ? "true\n" : "false\n");
}
$ make foo
cc -O2 -pipe    -o foo foo.c 
foo.c: In function `main':
foo.c:7: warning: assignment makes integer from pointer without a cast
$ ./foo
false
true
$ 

//art

Reply via email to