Run‐time detection of undefined variables considered essential
Willett M. Kempton, Brian A. Wichmann · Software Practice and Experience · 1990
Abstract Access to an undefined variable—one which has never been assigned a value—can be detected by automatic means. However, today's compilers do not detect undefined variables comprehensively, and the environment dependence of these errors often allows them to evade normal testing procedures. Language standards for Pascal, Modula‐2 and Ada specify the circumstances in which the undefined variable access should cause an error trap. The logic of undefined in these standards is compared, revealing problems in security, implementation effort and consistency with accepted programming practice. An alternative logic, ‘undefined if totally‐undefined’ is proposed.