Subject: bin/3654: some GNU programs uses getenv without declaring it
To: None <gnats-bugs@gnats.netbsd.org>
From: None <arnej@math.ntnu.no>
List: netbsd-bugs
Date: 05/20/1997 09:25:32
>Number:         3654
>Category:       bin
>Synopsis:       some GNU programs uses getenv without declaring it
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue May 20 00:35:01 1997
>Last-Modified:
>Originator:     Arne H. Juul
>Organization:
	Norwegian University of Technology and Science
>Release:        NetBSD-current as of May 1997
>Environment:
	
System: NetBSD leon.imf.unit.no 1.2D NetBSD 1.2D (LEON) #1: Fri Apr 25 15:29:03 CEST 1997 arnej@leon.imf.unit.no:/usr/src/sys/arch/i386/compile/LEON i386


>Description:
	Some files use getenv without any declaration.  This
	means the compiler believes getenv returns int, when actually it
	returns (char *).  If int and (char *) have different sizes this
	might cause problems.

/usr/src/gnu/usr.bin/grep/getopt.c:353: warning: implicit declaration of function `getenv'
/usr/src/gnu/usr.bin/tar/getopt.c:336: warning: implicit declaration of function `getenv'
/usr/src/gnu/usr.bin/gdb/readline/history.c:424: warning: implicit declaration of function `getenv'
/usr/src/gnu/usr.bin/gdb/readline/tilde.c:221: warning: implicit declaration of function `getenv'

>How-To-Repeat:
	
	Recompile world with -Wall, grep for 'implicit.*getenv'
>Fix:
	
	Stick in extern char *getenv() in these files, or somehow make
	them #include stdlib.h, I don't know what is preferred.
>Audit-Trail:
>Unformatted: