|Synopsis:||Expressions shall not contain multiple side-effects due either to the same identifier being modified more than once, or due to the same identifier being modified and accessed.|
|For all but a few constructs in C, Standard C does not define the evaluation order even where there may be side-effects. Reliance on them can create problems which are very expensive to track down.
Even something as simple as two function references in the same expression can lead to problems.x = i++ + a[i]; /* WRONG - 2 side effects x assigned and i changed */ x = i + a[i]; /* RIGHT */ i++;
x = f() + g(); /* CAUTION - if f and g both modify and access the same externally visible identifier, big problemsmay result. */ t = f(); x = t + g(); /* SAFE, but may lead to expressions becoming hard to understand. */