Authors: Joseph Myers
Date: 2025-03-07
Submitted against: C23
Status: Open
Cross-references: 0078
C23 footnote 20, in 6.2.2 (Linkages of identifiers), says:
There is no linkage between different identifiers.
Is this footnote (not normative) referring only to linkage between identifiers defined by the user's program? Or is it also intended to say that there cannot be linkage between different library functions?
In practice, it is common that pointers to library functions with
compatible semantics may compare equal: that memcpy == memmove
, or
ldexp == scalbn
, for example. The response to C90 issue
0078 said that this is permitted. However, the footnote
in question was added in C99, which makes it less clear if that issue
response reflects the current intent.
It seems appropriate to amend both normative and non-normative text to make clear that it is OK for pointers to different library functions to compare equal.
In C23 7.1.2 (Standard headers), insert text as follows.
Any declaration of a library function shall have external linkage. Pointers to different library functions may compare equal where this is compatible with the semantics of those functions.FN)
FN)For example, it is possible that
memcpy == memmove
or thatldexp == scalbn
.
In C23 6.2.2 (Linkages of identifiers), amend footnote 20 as follows.
There is noThis document does not define any mechanism to establish linkage between different identifiers. As described in 7.1.2, it is possible that pointers to different library functions compare equal where that is compatible with the semantics of those functions.