ambiguous ?

Henry Spencer henry at utzoo.uucp
Sat Oct 28 03:43:38 AEST 1989


In article <2816 at trantor.harris-atd.com> bbadger at x102c.harris-atd.com (Badger BA 64810) writes:
>>... I have no objection
>>to operators whose specific purpose is to force order, when they are
>>broadly useful.  I do have considerable objection to code that depends
>>on evaluation order *without* putting the reader on notice of it by
>>explicitly using forcing operators.
>
>I'm not sure if you're saying that a known order of evaluation (OOE) is a 
>*bad* idea, or that you would rather accept an undefined order so that 
>all possible compiler optimizations which may depend on the OOE would be 
>legalized.

To clarify:  my view is that order-dependent code in C is almost always
a bad idea, and should be avoided like the plague, barring one or two
specialized constructs like && whose mission in life is order control.
If one is sensible and avoids order-dependent code, there is no reason
to forbid compiler reordering, and it does give more opportunity for
optimization.
-- 
A bit of tolerance is worth a  |     Henry Spencer at U of Toronto Zoology
megabyte of flaming.           | uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.lang.c mailing list