logoalt Hacker News

gpderetta06/16/20251 replyview on HN

FWIW, POSIX practically requires void otr and function otr inter-convertibility hence the support from GCC.


Replies

wahern06/16/2025

Not practically, but literally:

  Note that conversion from a void * pointer to a function
  pointer as in:

    fptr = (int (*)(int))dlsym(handle, "my_function");

  is not defined by the ISO C standard. This standard
  requires this conversion to work correctly on conforming
  implementations.
show 1 reply