Subject: bin/2276: usr.bin/make generates warning
To: None <gnats-bugs@NetBSD.ORG>
From: Gary D. Duzan <gary@wheel.tiac.net>
List: netbsd-bugs
Date: 03/31/1996 11:01:36
>Number:         2276
>Category:       bin
>Synopsis:       usr.bin/make generates warning
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Mar 31 11:20:01 1996
>Last-Modified:
>Originator:     Gary D. Duzan
>Organization:
	Northeastern University
>Release:        Sunday, March 31, 1996
>Environment:
	
System: NetBSD wheel.tiac.net 1.1B NetBSD 1.1B (WHEEL) #0: Mon Mar 18 09:37:26 EST 1996 gary@wheel.tiac.net:/root/src/sys/arch/i386/compile/WHEEL i386


>Description:
===> usr.bin/make
cc -O -I/root/src/usr.bin/make -DPOSIX -DSYSVINCLUDE  -Werror  -c arch.c
cc -O -I/root/src/usr.bin/make -DPOSIX -DSYSVINCLUDE  -Werror  -c buf.c
cc -O -I/root/src/usr.bin/make -DPOSIX -DSYSVINCLUDE  -Werror  -c compat.c
cc -O -I/root/src/usr.bin/make -DPOSIX -DSYSVINCLUDE  -Werror  -c cond.c
cc -O -I/root/src/usr.bin/make -DPOSIX -DSYSVINCLUDE  -Werror  -c dir.c
cc -O -I/root/src/usr.bin/make -DPOSIX -DSYSVINCLUDE  -Werror  -c for.c
cc -O -I/root/src/usr.bin/make -DPOSIX -DSYSVINCLUDE  -Werror  -c hash.c
cc -O -I/root/src/usr.bin/make -DPOSIX -DSYSVINCLUDE  -Werror  -c job.c
cc -O -I/root/src/usr.bin/make -DPOSIX -DSYSVINCLUDE  -Werror  -c main.c
cc -O -I/root/src/usr.bin/make -DPOSIX -DSYSVINCLUDE  -Werror  -c make.c
cc -O -I/root/src/usr.bin/make -DPOSIX -DSYSVINCLUDE  -Werror  -c parse.c
cc -O -I/root/src/usr.bin/make -DPOSIX -DSYSVINCLUDE  -Werror  -c str.c
cc1: warnings being treated as errors
str.c: In function `brk_string':
str.c:210: warning: passing arg 1 of `erealloc' from incompatible pointer type
*** Error code 1

Stop.
>How-To-Repeat:
	cd src/usr.bin/make ; make
	(found using make build)
>Fix:

   Replace char* with void*, as such:

diff -rc /usr/src/usr.bin/make/main.c /root/src/usr.bin/make/main.c
*** /usr/src/usr.bin/make/main.c	Fri Mar 29 07:43:56 1996
--- /root/src/usr.bin/make/main.c	Sun Mar 31 10:47:51 1996
***************
*** 991,1004 ****
   * erealloc --
   *	realloc, but die on error.
   */
! char *
  erealloc(ptr, size)
! 	char *ptr;
  	size_t size;
  {
! 	char *p;
  
! 	if ((p = (char *) realloc(ptr, size)) == NULL)
  		enomem();
  	return(p);
  }
--- 991,1004 ----
   * erealloc --
   *	realloc, but die on error.
   */
! void *
  erealloc(ptr, size)
! 	void *ptr;
  	size_t size;
  {
! 	void *p;
  
! 	if ((p = (void *) realloc(ptr, size)) == NULL)
  		enomem();
  	return(p);
  }
diff -rc /usr/src/usr.bin/make/nonints.h /root/src/usr.bin/make/nonints.h
*** /usr/src/usr.bin/make/nonints.h	Fri Mar 29 07:43:57 1996
--- /root/src/usr.bin/make/nonints.h	Sun Mar 31 10:48:14 1996
***************
*** 72,78 ****
  int PrintAddr __P((ClientData, ClientData));
  void Finish __P((int));
  char *emalloc __P((size_t));
! char *erealloc __P((char *, size_t));
  void enomem __P((void));
  int eunlink __P((const char *));
  
--- 72,78 ----
  int PrintAddr __P((ClientData, ClientData));
  void Finish __P((int));
  char *emalloc __P((size_t));
! void *erealloc __P((void *, size_t));
  void enomem __P((void));
  int eunlink __P((const char *));
  
>Audit-Trail:
>Unformatted: