This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: libiberty configure fails on svr4/svr5 native


> 2) Make configure pass arguments to these functions before testing.  
>    (Requires changes to autoconf.)

I think this is the right direction, because autoconf actually fails - so
this should probably be considered a bug in autoconf.  (Not autoconf proper,
but the AC_CHECK_FUNC definition in acgeneral.m4.)
However, it's not easy to tell what actually to pass to an arbitrary
function.  We might try to pass a number of NULLs (writing them as "0",
of course), starting with one and going up to some arbitrary number.
However, that would lead to a lot of code expansion in the configure
scripts, and also make it much slower to determine that a function
doesn't exist.
Or we could try a little harder to outsmart the host and assign the
function's address to a pointer variable.

Would this test suceed?

#include <assert.h>

int main()
{
  char memcpy();
  char (*f)() = memcpy;
  return 0;
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]