...
Noncompliant Code Example (Identifiers with External Linkage)
In addition to symbols defined as functions in each C standard library header, identifiers with external linkage include errno
and math_errhandling
, among others, regardless of whether any of them are masked by a macro of the same name.
This noncompliant example provides definitions for the C standard library functions malloc()
and free()
. Although this practice is permitted by many traditional implementations of UNIX (for example, the Dmalloc library), it is undefined behavior according to the C Standard. Even on systems that allow replacing malloc()
, doing so without also replacing aligned_alloc()
, calloc()
, and realloc()
is likely to cause problems.
...
Noncompliant Code Example (errno
)
In addition to symbols defined as functions in each C standard library header, identifiers with external linkage include errno
and math_errhandling
, among others, regardless of whether any of them are masked by a macro of the same name.
According to the C Standard, 7.5, paragraph 2 [ISO/IEC 9899:2011], the behavior of a program is undefined when
...