Thread View: gnu.utils.bug
1 messages
1 total messages
Started by Daryl V. McDaniel
Sun, 04 Oct 1992 17:08
Bug in make 3.62
Author: Daryl V. McDaniel
Date: Sun, 04 Oct 1992 17:08
Date: Sun, 04 Oct 1992 17:08
88 lines
3427 bytes
3427 bytes
Bug Report for GNU make-3.62
System: i486-66 based desktop PC clone (Zeos)
OS: UHC SVR4.0.3.6
Compiler: GCC 2.2.2
Build environment:
UFS disk partition with 87MB free
GNU C compiler
/usr/ccs/bin/make
16MB physical memory
800MB virtual memory (swap space size)
6 users
Load Average 0.01
When compiling make-3.62 with gcc 2.2.2, I got two groups of warnings:
1) main.c: line 347: arguments 2 and 3 of setvbuf are of wrong type
2) function.c: local declaration of fork does not match global
gcc -DUSG -DHAVE_DUP2 -DPOSIX -O -c function.c -o function.o
function.c: In function `expand_function':
function.c:329: warning: type mismatch with previous external decl
/usr/local/lib/gcc-lib/i486-zeos-sysv4/2.2.2/include/unistd.h:186: warning: previous external decl of `fork'
function.c:329: warning: local declaration of `fork' doesn't match global one
The version produced from this build dumps core upon invocation.
Examination of the error messages showed that the setvbuf() call in main.c
had the second and third arguments reversed, as per the on-line
documentation for setvbuf(). Swapping these two arguments eliminated the
error message from subsequent builds. The "make" produced from fixing this
bug works on all makefiles I have subsequently tried it on.
Problem 2 stems from fork() being declared as "extern int fork();" in
function.c, while the system header files declare fork as "pid_t fork();".
Fixing this problem, while a good thing, is cosmetic instead of functional.
I have enclosed relevant portions of the Makefile and main.c to show what I
have changed. Fixes to function.c are left as an exercise to the student.
8-) Lots of smileys.
>From the Makefile:
#
# Makefile for GNU Make
#
CC=gcc # Add compiler definition for GCC
CFLAGS = $(defines) -O # Don't need symbols any more
LDFLAGS = -g
defines =-DUSG -DHAVE_DUP2 -DPOSIX # Other defines invoke bad things
LOAD_AVG =-DKERNEL_FILE_NAME=\"/unix\"
LOADLIBES =-lelf # This is where nlist lives
# If your system doesn't have alloca, or the one provided is bad,
# get it from the Emacs distribution and define these.
#ALLOCA = alloca.o # Seems to work without this
#ALLOCASRC = alloca.c
>From main.c:
/* Make sure stdout is line-buffered. */
#if (defined (USGr3) || defined (HPUX) || defined (hpux) \
|| defined (M_XENIX) || defined (APOLLO))
setvbuf (stdout, (char *) 0, _IOLBF, BUFSIZ);
#else /* Not USGr3 and not HPUX et al. */
#ifdef USG
#ifdef sgi
setvbuf (stdout, _IOLBF, xmalloc (BUFSIZ), BUFSIZ);
#else
setvbuf (stdout, (char *) 0, _IOLBF, BUFSIZ); /* BUGFIX: Swap 2nd & 3rd args */
#endif
#else /* Not USG. */
setlinebuf (stdout);
#endif /* USG. */
#endif /* USGr3. */
-=-=-=-=-=-=-=-=-=-=-
Daryl V. McDaniel (503) 643-6137
Micronetics darylm@mnet.com
Aloha Research Group ...sun.com!nosun!illian!darylm
Beaverton, Oregon, USA ...{qiclab, sopwith, tessi}!illian!darylm
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads