unspecified and undefined behavior

1. Unspecified behavior

C11 Section 3.4.4, page 4:

"use of an unspecified value, or other behavior where this International Standard provides

two or more possibilities and imposes no further requirements on which is chosen in any

instance"

C11 Section J.1 Page 554 has a list of all the "unspecified behavior".

It is up to implementation to decide how the "unspecified behavior" is documented. an implementation may chose to document a behavior, in such case, the "unspecified behavior" is also "implementation defined behavior (C11 Section 3.4.1 Page 3)". If an implementation chose to not document a behavior, the "unspecified behavior" is also called "undocumented behavior", although C11has been quiet on "undocumented unspecified behavior".

2. Undefined behavior:

C11 Section 3.4.3, page 4:

"upon use of a nonportable or erroneous program construct or of erroneous data,

for which this International Standard imposes no requirements".

C11 Section J.2 Page 557 has a list of "undefined behavior".

It is important to point out that "unspecified behavior" in general, will not lead to a program crash, whereas "undefined behavior" can lead to a program crash.