Definition of boolean type

Doug Gwyn gwyn at smoke.BRL.MIL
Wed Mar 1 15:45:18 AEST 1989


In article <6849 at pogo.GPID.TEK.COM> rickc at pogo.GPID.TEK.COM (Rick Clements) writes:
>With the compiler I am currently using, I use "if (x == FALSE)" or
>"if (x != FALSE).  ...  The compiler I am using generates LESS code
>this way.  ("if (x)" causes it to go to the work of converting it to
>a 1 or 0 with some less than efficient code.

That's pretty strange -- "if(x)" means no more and no less than
"if x is nonzero", which nearly all instruction sets support directly.
It's easy to imagine a dumb compiler that produces MORE code for
"if(x!=0)" but not one that produces LESS code.



More information about the Comp.lang.c mailing list