Abstract
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.
DOI
10.17705/1CAIS.01334
Recommended Citation
Reed, A., & Wasley, K. (2004). The Subtle and Counterintuitive Hazards of Non-Sequential Evaluation in Languages of the C Family. Communications of the Association for Information Systems, 13, pp-pp. https://doi.org/10.17705/1CAIS.01334
When commenting on articles, please be friendly, welcoming, respectful and abide by the AIS eLibrary Discussion Thread Code of Conduct posted here.