C, Ocean Edition I

Annex C. Implementation-Defined Behavior

Annex
C
ISO C99 mapping
Annex J.3, J.4, J.1
Status
Normative

C.0 The Obligation

An implementation shall document its choice for every item in this annex.

The documentation shall be available to a programmer using the implementation, shall be specific enough to predict program behavior, and shall be versioned alongside the implementation.

The admission test. An item belongs in this annex only when supported targets genuinely differ. Historical specification indecision is not a target property. If every supported modern target can share one reasonable rule, the language defines it universally instead. See clause 0.3 and behavior.md section 112.

The list below is therefore much shorter than ISO C99 Annex J.3, and every entry names a real difference between real machines.


C.1 Translation


C.2 Environment


C.3 Types, Sizes, and Layout


C.4 Pointers


C.5 Arithmetic

The following remain implementation-defined because targets genuinely differ. Everything else about arithmetic is defined by clause 6.5.


C.6 Traps and Diagnostics


C.7 Library


C.8 Locale-Specific Behavior

The following depend on the locale in effect. An implementation shall document the behavior of every locale it provides, including the "C" locale.

Note. ISO C99 treats locale-specific behavior as a separate category. Ocean Edition I folds it into implementation-defined behavior, because the obligation is the same one: document what you chose.


C.9 Unspecified Behavior

This is the complete list of behaviors where this specification permits a choice and does not require the implementation to document which it makes. Nothing else in the language is unspecified.

Design note. Each of these permits a real and valuable implementation technique, and none of them can be observed by a program that does not go looking. A proposal to add a sixth entry should be treated as a last resort, under behavior.md section 113.


C.10 What Is Not in This Annex

The following are implementation-defined in ISO C99 and are defined by Ocean Edition I. They are listed here so that an implementer reading the ISO annex does not carry them over.

Subject Ocean Edition I rule Clause
Signedness of plain char never negative 6.2.6.3
Number of bits in a byte exactly 8 6.2.6.1
Signed integer representation two's complement 6.2.6.2
Padding bits in integer types none 6.2.6.2
Trap representations of integer types none 6.2.6.2
Result of signed overflow wraps 6.5.6
Result of narrowing conversion to a signed type truncates 6.3.1.3
Result of signed right shift arithmetic 6.5.7
Signedness of a plain int bitfield signed 6.7.2.2
Compatible type of an enumeration first type that fits, from a fixed list 6.7.2.3
Order of evaluation of subexpressions left to right 6.5.0.1
Order of evaluation of function arguments left to right 6.5.2.2
Values of padding bytes after zero initialization zero 6.2.6.1
Whether errno is set by a math function it is set 7.2.6
Whether an allocation of size zero returns a unique pointer it returns null 7.2.18
Whether #pragma once is supported it is required 6.10.2.4
Whether translation output is reproducible it is required 4.10
The source of __DATE__ and __TIME__ the declared translation timestamp K.5.2
Whether optimization decisions may vary between runs they may not K.9
The external name of a namespace member fixed by the language as a__b__name 6.9.6.4
Whether a namespace affects layout or calling convention it does not 6.9.6.3
Spelling of the boolean type and its values bool, true, false are keywords 6.4.1.3
Definition of NULL as 0 or (void *)0 a keyword with its own type 6.4.4.6
Whether a literal 0 may serve as a null pointer it may not 6.3.2.3