Rearranging FP expressions

Henry Spencer henry at utzoo.uucp
Wed Sep 28 03:46:13 AEST 1988


In article <4700017 at m.cs.uiuc.edu> wsmith at m.cs.uiuc.edu writes:
>I realize this topic has been beat to death and its probably too late
>for the ANSI C committee to do anything about it...

Much too late, given that the matter has already been addressed:  expressions
must be evaluated as given unless rearrangement would yield the same results.
("The same" in a programming sense, not just in a mathematical sense.)

>A proposed solution:
>	Expressions enclosed in double parentheses may not be rearranged,
>	all other expressions may be rearranged in "semantically valid" ways.

Doesn't work too well.  The trouble is that extra parentheses are common as
a result of macro expansion.  To do this sort of thing well, you really
need another *kind* of parentheses.  Such schemes have been proposed, but
did not get accepted.
-- 
NASA is into artificial        |     Henry Spencer at U of Toronto Zoology
stupidity.  - Jerry Pournelle  | uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.lang.c mailing list