Definition of boolean type

Doug Gwyn gwyn at smoke.BRL.MIL
Fri Mar 3 00:58:29 AEST 1989


In article <2892 at nunki.usc.edu> jeenglis at nunki.usc.edu (Joe English) writes:
-gwyn at brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:
->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.
-If I recall correctly, it generated the same amount of code
-for "if(x)" and "if(x!=0)," but it went something like:

I can also believe that a compiler would produce exactly same code
for "if(x)" and "if(x!=0)", even if it's horrible code in both cases.
I still wonder how one could get WORSE code for "if(x)", though.



More information about the Comp.lang.c mailing list