This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH 3/3] libctf: look for a qsort_r that functions properly
- From: Pedro Alves <palves at redhat dot com>
- To: Nick Alcock <nick dot alcock at oracle dot com>, binutils at sourceware dot org
- Cc: jose dot marchesi at oracle dot com, John dot W dot Marshall at glasgow dot ac dot uk, sebastian dot huber at embedded-brains dot de
- Date: Wed, 5 Jun 2019 11:25:06 +0100
- Subject: Re: [PATCH 3/3] libctf: look for a qsort_r that functions properly
- References: <20190603204735.203510-1-nick.alcock@oracle.com> <20190603204735.203510-3-nick.alcock@oracle.com>
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?
Thanks,
Pedro Alves