Background
The POSIX standard adds a lot of library functions and other identifiers to the C language. In the description of the dlsym()
function, it says (with my emphasis):
SYNOPSIS
#include <dlfcn.h> void *dlsym(void *restrict handle, const char *restrict name);
DESCRIPTION
The dlsym() function shall obtain the address of a symbol (a function identifier or a data object identifier) ...
The C standard doesn't guarantee that a function pointer can be converted to a void *
, or even that the size of the pointers are the same. This effectively adds an additional restriction on C's type system.
Question
My question is this:
- Is there a normative reference for this restriction of C's type system, or is it only deducible from the description of certain library functions?
- Is POSIX even implementable on a system where
sizeof (function pointer) > sizeof (void *)
?
References
- The C11 Standard (final public draft): n1570
- The POSIX Standard from The Open Group: POSIX.1-2008
- The POSIX
dlsym()
function