AC_REPLACE_FUNCS and function prototypes

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

 



Hi,

I want to use a non-standard function like memrchr().  So I added:

   AC_REPLACE_FUNCS(memrchr)

in configure.ac, and to prevent warnings, add

   #ifndef HAVE_MEMRCHR
   extern void *memrchr(const void *, int, size_t);
   #endif

in a header file.

Now, I was able to compile it on platforms which have no memrchr()
function in libc.  But on Linux (glibc), I got a warning like this:

  warning: implicit declaration of function `memrchr'

because the memrchr() declaration in string.h is protected by #ifdef
__USE_GNU.  How can I handle this situation properly?  I want to avoid
unconditionally defining _GNU_SOURCE because its side effects are
unpredictable.

Regards,

--
Yonenaga Masao


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux