Expression Sequencing Query

Ray Butterworth rbutterworth at watmath.UUCP
Wed Oct 22 00:01:49 AEST 1986


> The ANSI C draft standard provides the unary plus operator for coercing
> evaluation order.  Thus
>     a = +(b + c) + +(d) ;
> should force the sum of b+c to be calculated and added to d. This is
> probably less pleasing to the eye but, as has been pointed out before,
> parentheses already have a meaning in C, and it is explicitly NOT one
> that forces order of evaluation.

Does X3J11 (or any other C "standard") say anything about the
order of evaluation of (possibly redundant) cast expressions?

e.g.      ( ((double)(a+b)) + ((double)(c+d)) )

where a, b, c, and d may or may not be type (double)?

It would certainly be prettier than the unary " +" operator,
and certainly more obvious that the programmer really did want
the given grouping.



More information about the Comp.lang.c mailing list