Defect Report #079
Submission Date: 03 Dec 93
Source: Clive Feather
Item 16 - constancy of system library function addresses
(These questions approach the same problem from three slightly different
- If a pointer to a given standard library function (say strlen)
is evaluated in two different translation units, and the pointers
compared, must they compare equal?
- Can a conforming implementation declare a standard library function
as having internal linkage, or must the identifiers with file scope
declared in standard headers have external linkage?
If the contents of the header <string.h>
include the following definition of strlen,
is the implementation conforming?
static size_t strlen (const char *__s)
size_t __len = 0;
Since the answer to question (b) is needed for question (a) it
is given first.
b) Since, according to the fourth item in subclause 7.1.3,
the library function prototypes are implicitly
extern, the standard library functions have
a) If the usage of strlen
is such that standard library functions are
referred to, the pointers must compare equal by the requirements of
subclauses 184.108.40.206 and 220.127.116.11.
c) The contents of standard headers are implementation-defined. For
instance, they may contain code written in other languages. It is not
the job of this Committee to mandate implementation. Whatever their
contents, including a standard header must achieve the effects required by
the C Standard.
Previous Defect Report
< - >
Next Defect Report