Skip to contentSkip to conversation

comparisons yield bool instead of int?

DISCUSSION Ben Pfaff 1 participant 1 message Jul 13, 2012 Sparse checker

lore
Share & tools
lore

Ben Pfaff

author
#0 lore raw

The C standard says that equality operators yield "int", but sparse thinks that they yield "bool":

    blp@sigsegv:~/sparse$ cat test.c
    static void f(void)
    {
       sizeof(1 == 2);
    }
    blp@sigsegv:~/sparse$ ./sparse test.c
    test.c:3:4: warning: expression using sizeof bool
    blp@sigsegv:~/sparse$ git rev-parse HEAD
    970d7169d75068146152ba01a66381c800dbeb71

Thanks,

Ben.