Subject: Re: compiling new kernel failed
To: None <>
From: Greg Oster <>
List: current-users
Date: 05/06/1999 09:58:43 writes:
> hi,
> just tried to re-compile a kernel from current sources (supped this
> morning) and got this one:
> cc  -O2 -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes  -Wpointer-ari
> th -mno-fpu -I. -I../../../../arch -I../../../.. -nostdinc -DSUN4M -DBLINK -D
> main.c
> cc1: warnings being treated as errors
> ../../../../kern/init_main.c:174: warning: return type of `main' is not `int'
> *** Error code 1
> Stop.
> last kernel compile I did on this machine was on Apr 26. any ideas
> anyone? the version of init_main.c is:
> /*      $NetBSD: init_main.c,v 1.145 1999/04/01 00:22:45 thorpej Exp $  */
> I've rebuild userland (UPDATE=1) and rebooted the beast, but that
> doesn't change anything...

Not having seen this error (and having built a sparc kernel as recently as 
yesterday) I got interested in this... 

oster@animal-17> make init_main.o
cc  -O2 -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes  -Wpointer-arith -Wno-main -mno-fpu -I. -I../../../../arch -I../../../.. -nostdinc -DSUN4 -DSUN4C -DSUN4M -DRASTERCONSOLE -DLKM -DNS -DMAXUSERS=32 -D_KERNEL  -c ../../../../kern/init_main.c
oster@animal-18> head -1 ../../../../kern/init_main.c
/*      $NetBSD: init_main.c,v 1.145 1999/04/01 00:22:45 thorpej Exp $  */

After a bit more putzing, I noticed that I have a "-Wno-main" in the above, 
and you don't have it...   The silly question is why "-Wno-main" is not part
of your  compiler flags...

What does 'gcc --version' tell you?  The "-Wno-main" should be being set by 
the lines: 

HAVE_GCC28!=    ${CC} --version | egrep "^(2\.8|egcs)" ; echo 
INCLUDES=       -I. -I$S/arch -I$S -nostdinc
CWARNFLAGS?=    -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \
.if (${HAVE_GCC28} != "")
CWARNFLAGS+=    -Wno-main

in the Makefile generated by config (It's certainly been there for the kernels 
I've been building...)


Greg Oster