Subject: Re: defining POSIX when building gcc?
To: Bill Sommerfeld <>
From: Simon Burge <>
List: tech-toolchain
Date: 08/10/1999 14:01:16
Bill Sommerfeld wrote:

> Currently, when you link gcc, you get the following warning:
> cc   -o cc1 c-lex.o c-pragma.o c-decl.o c-typeck.o c-convert.o c-aux-info.o c-common.o c-iterate.o c-parse.o c-lang.o /usr/src/gn
u/usr.bin/egcs/common/obj.i386/libcc1.a -lgnumalloc
> getpwd.o: warning: getwd() possibly used unsafely, consider using getcwd()
> Now, if bits of gcc were built -DPOSIX, this wouldn't happen.

The real problem with this particular instance is in getpwd.c:

	#if !(defined (POSIX) || defined (USG) || defined (VMS)) || defined (HAVE_GETWD)

It would be easier to wrap the whole test in !defined(HAVE_GETPWD) and
define that in dist/gcc/config/netbsd.h.

FWIW, I just tried to build egcs with your patch to define POSIX, and
it worked ok - however, would it be more correct to put that define in