TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
C++ Coding Standard
Search

Rule:  CFL#005Checked automatically with code checker

Synopsis:Do not access a modified object more than once in an expression
Language:C++
Severity Level:1
Category:Control Flow


Description:

The evaluation order of sub-expressions within an expression is undefined. See also [POR#029].

Example:

v[i] = ++c;	// right
v[i] = ++i;	// wrong: is v[i] or v[++i] being assigned to?
i = i + 1;	// right
i = ++i + 1;	// wrong: i is modified twice in an expression