People seem to make a point of distinguishing between implementation-defined, unspecified, and undefined behavior. What do these mean?
First of all, all three of these represent areas in which the C Standard does not specify exactly what a particular construct, or a program which uses it, must do. This looseness in C’s definition is traditional and deliberate: it permits compiler writers to (a) make choices which allow efficient code to be generated by arranging that various constructs are implemented as “however the hardware does them” (see also question 14.4a), and (b) ignore (that is, avoid worrying about generating correct code for) certain marginal constructs which are too difficult to define precisely and which probably aren’t useful to well-written programs anyway (see for example the code fragments in questions 3.1, 3.2, and 3.3). These three variations on “not precisely defined by the standard” are defined as: implementation-defined: The implementation must pick some behavior; it may not fail to compile the program. (The program using the construct is not incorrect.) The choice must be documented. The Sta
Related Questions
- People seem to make a point of distinguishing between implementation-defined, unspecified, and undefined behavior. Whats the difference?
- People seem to make a point of distinguishing between implementation-defined, unspecified, and undefined behavior. What do these mean?
- Whats the difference between implementation-defined, unspecified, and undefined behavior?