In the family of programming languages derived from the C programming language, the order of evaluation of expressions between sequence points is left undefined and may be counterintuitive. While most programmers assume that this lack of a defined order refers only to a lack of preference between left-to-right and right-to-left sequential evaluation, the standards actually permit, and language processors implement, a variety of non-sequential evaluation orders. In some cases, particularly those where expressions containing sequence points are combined without an intervening sequence point, computed results can be unanticipated, and can vary with different compilers for the same code. Yet these results fail to trigger any warning from compilers or syntax-checkers. Because languages of the C family dominate Information Systems curricula and new business application code, the risk that code in those languages may give incorrect results without any warning from automated tools presents significant hazards against the integrity of financial calculations. This article explains those hazards and outlines countermeasures.
Reed, Adam Victor and Wasley, Knox B.
"The Subtle and Counterintuitive Hazards of Non-Sequential Evaluation in Languages of the C Family,"
Communications of the Association for Information Systems: Vol. 13
, Article 34.
Available at: https://aisel.aisnet.org/cais/vol13/iss1/34