On Wed, Jan 03, 2001 at 04:37:44PM +1100, Brian May wrote: > >>>>> "Ben" == Ben Collins <[EMAIL PROTECTED]> writes: > > Ben> By default, __USE_GNU is defined. If you want to define it > > (perhaps you meant "...is undefined"???) > > Ben> explicitly, then use -D_GNU_SOURCE in your CFLAGS. > > It doesn't seem to be the case here: > > > gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -Wall -c -o main.o > > main.c > main.c: In function `xmlparse_file': > main.c:14: warning: implicit declaration of function `asprintf' > > > >gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -g -O2 -D_GNU_SOURCE -Wall > >-c -o main.o main.c > [no warnings] > > So it looks like I have to define _GNU_SOURCE explicitly in order to > get rid of the warning.
No, __USE_GNU is defined, unless one of the other _XXX_SOURCE macros are also defined (like _SVID_SOURCE or _XOPEN_SOURCE, or similar). Most likely the program you are compiling is defining one of these aswell. In that case, yes, you do have to define _GNU_SOURCE explicitly. -- -----------=======-=-======-=========-----------=====------------=-=------ / Ben Collins -- ...on that fantastic voyage... -- Debian GNU/Linux \ ` [EMAIL PROTECTED] -- [EMAIL PROTECTED] -- [EMAIL PROTECTED] ' `---=========------=======-------------=-=-----=-===-======-------=--=---'