- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
/* Writing: cosine = (double (*)(double)) dlsym(handle, "cos");
would seem more natural, but the C99 standard leaves
casting from "void *" to a function pointer undefined.
The assignment used below is the POSIX.1-2003 (Technical
Corrigendum 1) workaround; see the Rationale for the
POSIX specification of dlsym(). */
*(void **) (&cosine) = dlsym(handle, "cos");
inkanus-gray 28.09.2014 13:47 # 0
Сишка не нужна.
Dummy00001 28.09.2014 16:49 # +3
"Note that conversion from a void * pointer to a function pointer as in [...] is not defined by the ISO C standard. This standard requires this conversion to work correctly on conforming implementations."
ну да это не первый раз (и я уверен не последний) где POSIX идиотам из ISO мозги вправляет.
anonimb84a2f6fd141 28.09.2014 21:41 # −8