Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

People seem to make a point of distinguishing between implementation-defined, unspecified, and undefined behavior. What do these mean?

0
Posted

People seem to make a point of distinguishing between implementation-defined, unspecified, and undefined behavior. What do these mean?

0

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

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123