Subject: Re: -current kernel build warnings
To: Clarence Wilkerson <netbsd@hopf.math.purdue.edu>
From: Iain Hibbert <plunky@skate.demon.co.uk>
List: current-users
Date: 04/06/1996 16:09:02
On Sat, 6 Apr 1996, Clarence Wilkerson wrote:

> I get this with an uptodate -current kernel build
> 
> cc  -O2 -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes -I. -I../../../../arch -I../../../.. -DSUN4C -DTIMEZONE="0" -DDST="0" -DSWAPPAGER -DVNODEPAGER -DDEVPAGER -DKTRACE -DRCONSOLE -DSYSVMSG -DSYSVSEM -DSYSVSHM -DCOMPAT_09 -DCOMPAT_10 -DFFS -DNFSSERVER -DNFSCLIENT -DKERNFS -DFIFO -DINET -DTCP_COMPAT_42 -DCOMPAT_43 -DLKM -DCOMPAT_SUNOS -D_KERNEL  -c ../../../../kern/kern_descrip.c
> cc1: warnings being treated as errors
> ../../../../kern/kern_descrip.c: In function `sys_fstat':
> ../../../../kern/kern_descrip.c:408: warning: `error' may be used uninitialized in this function
> ../../../../kern/kern_descrip.c: In function `sys_fpathconf':
> ../../../../kern/kern_descrip.c:471: warning: control reaches end of non-void function
> *** Error code 1

I sent in a PR about this (kern/2255), and a bunch of other similar warnings
last week, though I'm now not sure that I should have done.  I was upgrading
from december sources to -current at the time, compiling a kernel before
building the new userland.

I've since compiled the new gcc, and when making a new kernel I don't get
these errors (even though, in many cases the files have not been changed) so
it may be that the new gcc knows that functions such as panic() are
non-returning, which is where the problem was. (if you don't know that 
panic() doesn't come back, then it looks as if the variable is used 
uninitialised..)

I suspect this only shows up in the sparc port, since I (think I) read the
other day that we are now using -Wall for the kernel makefile and nobody 
else is yet.

]ain