...
Implementations conforming to C are required to declare errno
in <errno.h>
, although some historic implementations failed to do so.
Exceptions
DCL37-C-EX1: Provided that a library function can be declared without reference to any type defined in a header, it is permissible to declare that function without including its header provided that declaration is compatible with the standard declaration.
...
Such code is compliant because the declaration matches what stdlib.h
would provide and does not redefine the reserved identifier. However, it would not be acceptable to provide a definition for the free()
function in this example.
DCL37-C-EX2: For compatibility with other compiler vendors or language standard modes, it is acceptable to create a macro identifier the same as a reserved identifier so long as the behavior is idempotent, as in this example:
Code Block | ||||
---|---|---|---|---|
| ||||
/* Sometimes generated by configuration tools such as autoconf */ #define const const /* Allowed compilers with semantically equivalent extension behavior */ #define inline __inline |
DCL37-C-EX3: As a compiler vendor or standard library developer, it is acceptable to use identifiers reserved for your implementation. Reserved identifiers may be defined by the compiler, in standard library headers, or headers included by a standard library header, as in this example declaration from the glibc standard C library implementation:
...