...
The C99 standard identifies four different kinds of non-portable behavior:
...
. Each section of Annex J
...
of the C99 standard enumerates distinct instances of behaviors of each kind.
Nonportable Behavior | Definition | Annex J Section |
---|---|---|
Behavior for which the standard provides two or more possibilities and imposes no further requirements on which is chosen in any instance. | J.1 | |
Behavior, upon use of a nonportable or erroneous program construct or of erroneous data, for which the standard imposes no requirements. An example of undefined behavior is the behavior on integer overflow. | ||
Unspecified behavior whereby |
Sections 1 through 4 of Annex J of the C99 standard enumerate distinct instances of unspecified, undefined, implementation-defined, and locale-specific behavior, respectively.
C99 Section 3.4.1 defines implementation-defined behavior as
...
each implementation documents how the choice is made. | J.3 | |
Behavior that depends on local conventions of nationality, culture, and language that each implementation documents. | J.4 |
An example of implementation-defined behavior is the propagation of the high-order bit when a signed integer is shifted right.C99 Section 3.4.4 defines unspecified behavior as
...
An example of unspecified behavior is the order in which the arguments to a function are evaluated.
...