Re: Which header a symbol is declared in (AC_CHECK_DECLS) ?

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

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Konstantin Andreev on 4/27/2009 3:20 AM:
> Hello.
> 
> Could you advise, how to correctly determine which header a symbol is
> declared in ?

Why?  Functionally, all you need to know is whether a symbol is declared
within a set of headers, rather than trying to go the extra mile to figure
out which exact header.  So for this particular case, I would have used
something like:

AC_CHECK_DECLS([bzero],[],[],[AC_INCLUDES_DEFAULT
[#include <string.h>
#ifdef HAVE_STRINGS_H
# include <strings.h>
#endif
]])

to find whether bzero is declared in either string.h or strings.h, then
include both headers in my code.

But ultimately, bzero is declared obsolete by POSIX.  If you REALLY want
to be portable, I'd write your code to use memset and not bzero.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@xxxxxxx
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkn1oGUACgkQ84KuGfSFAYDaNQCdGq1z6K33pnCdAhYT1VjiPJgN
CmMAoKOE4ug6lkuXOZYNXv37jdFsb9BO
=cQa6
-----END PGP SIGNATURE-----


_______________________________________________
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