C IF statement efficiency...

Henry Spencer henry at utzoo.uucp
Sat Aug 20 01:45:27 AEST 1988


In article <8808171400.AA05122 at ucbvax.Berkeley.EDU> U23405 at UICVM writes:
>          if (big > small)             if (big > small)
>               return big;                  return big;
>          else                         return small;
>               return small;

Most C compilers should generate precisely the same code for these.
Really dumb ones might generate an extra "return;" after the lefthand
code, not realizing that it was unreachable.
-- 
Intel CPUs are not defective,  |     Henry Spencer at U of Toronto Zoology
they just act that way.        | uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.lang.c mailing list