[PATCH 3/3] libctf: look for a qsort_r that functions properly

Pedro Alves palves@redhat.com
Wed Jun 5 10:25:00 GMT 2019

On 6/3/19 9:47 PM, Nick Alcock wrote:

> We cannot just look for any declaration of qsort_r, because some
> operating systems

OOC, could you give some examples?

> have a qsort_r that has a different prototype
> but which still has a pair of pointers in the right places (the last two
> args are interchanged), so we cannot rely on compilation errors to flag
> up a problem.

> So, instead, use AC_RUN_IFELSE to check for the function of qsort_r(),
> passing function pointers in to both args and making sure that we never
> actually dereference the arg pointer.

AC_RUN_IFELSE is really best avoided; obviously you can't run when
cross compiling.

How does gnulib handle this?

Pedro Alves

More information about the Binutils mailing list