tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: qsort_r

Sneaking in because of a reason..

 |> On Mon, 09 Dec 2013, Mouse wrote:
 |>> I actually don't see anything that promises that a pointer to a 
 |>> function type may be converted to a pointer to void, nor back 
 |>> again (except, in each direction, when the original pointer is 
 |> Sorry, I did not express myself clearly enough.  C does not 
 |> promise that function pointers can be converted to or from void* 
 |> pointers, but I believe that all existing NetBSD implementations 

Rich Felker corrected my worldview and correctly pointed out that
POSIX actually does add an additional constraint in [1]:

  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.

  [1] <>


Home | Main Index | Thread Index | Old Index