Oracle® Solaris Studio 12.4: C User's Guide

Exit Print View

Updated: March 2015
 
 

6.9 Grouping and Evaluation in Expressions

K&R C gives compilers a license to rearrange expressions involving adjacent operators that are mathematically commutative and associative, even in the presence of parentheses. However, ISO C does not grant compilers this same freedom.

This section discusses the differences between these two definitions of C and clarifies the distinctions between an expression’s side effects, grouping, and evaluation by considering the expression statement from the following code fragment.

int i, *p, f(void), g(void);
/*...*/
i = *++p + f() + g();