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

Re: glibc devel info pages



On Wed, Jan 03, 2001 at 04:47:55PM +1100, Brian May wrote:
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> #include <stdarg.h>
> 
> but still get a warning:
> 
> gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include    -g -O2 -Wall -c -o main.o `test -f main.c || echo './'`main.c
> main.c: In function `xmlparse_file':
> main.c:15: warning: implicit declaration of function `asprintf'
> 
> which according to the man page should exist in <stdio.h>
> 
> (of course this file uses asprintf not vasprintf, but I have had
> similar problems for both functions).

Maybe

#define _GNU_SOURCE /* at the top of each relevant file */

I think they're both GNU extensions so you need to define the
_GNU_SOURCE macro.  I'm guessing that's generally true of many of these
automatic memory allocating library functions that a similarly named to
the C89, C9x or POSIX versions (sprintf/vsprintf/snprintf/etc...).

Would be nice if the info documentation was more complete.  I was
surprised when I found libc contained all of the XDR functions of
libnsl?  This is only buried in one file (besides the library) in the
Debian packages (/usr/doc/libc6/INTERFACE.gz).  It is noted as not being
documentated at the GNU website for the libc documentation...  The
funny thing is libc6-dev provides these functions in libc6 and the
separate libnsl.  Guess libnsl is there for hysterical raisans.  Though,
one can only guess if the implementations are different, or if one is
"better" than the other.

-- 
Eric G. Miller <egm2@jps.net>



Reply to: