Subject: kern/2255: warnings treated as errors while compiling kernel
To: None <gnats-bugs@NetBSD.ORG>
From: Iain Hibbert <plunky@skate.demon.co.uk>
List: netbsd-bugs
Date: 03/24/1996 13:00:43
>Number:         2255
>Category:       kern
>Synopsis:       warnings are given when compiling a kernel, treated as errors so need to be fixed.
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Mar 24 11:35:02 1996
>Last-Modified:
>Originator:     Iain Hibbert
>Organization:
	
>Release:        1.1B
>Environment:
	
System: NetBSD skate.demon.co.uk 1.1 NetBSD 1.1 (skate) #0: Sun Dec 10 13:57:07 GMT 1995 plunky@skate.demon.co.uk:/home/plunky/src/sys/arch/sparc/compile/skate sparc


>Description:
	I'm trying to build myself a kernel (sup on Sunday 23rd), but am getting
lots of errors (formerly warnings I guess), mostly to do with the fact that the compiler
doesn't recognise that the panic() call never returns..  so there needs to be some
small modifications.  I include all the problems I've encountered below, and the way
that I've fixed them though I'm not sure that its always the correct way, so its not
sent as a patch.  funnily enough, the files are not all recently modified so I guess
something changed in the Makefile recently?
	
>How-To-Repeat:
	
>Fix:
	
../../../../kern/kern_descrip.c: In function `sys_fstat':
../../../../kern/kern_descrip.c:409: warning: `error' may be used uninitialized in this function

initialize it to 0

../../../../kern/kern_descrip.c: In function `sys_fpathconf':
../../../../kern/kern_descrip.c:472: warning: control reaches end of non-void function

put a return(0) at the end

../../../../kern/uipc_usrreq.c: In function `unp_attach':
../../../../kern/uipc_usrreq.c:324: warning: `error' may be used uninitialized in this function

initialize it to 0

../../../../miscfs/deadfs/dead_vnops.c: In function `dead_badop':
../../../../miscfs/deadfs/dead_vnops.c:343: warning: control reaches end of non-void function

put a return(0) at the end (actually, I guess it could be void instead of int)

../../../../miscfs/fdesc/fdesc_vnops.c: In function `fdesc_attr':
../../../../miscfs/fdesc/fdesc_vnops.c:434: warning: `error' may be used uninitialized in this function

initialize it to 0

../../../../miscfs/fdesc/fdesc_vnops.c: In function `fdesc_setattr':
../../../../miscfs/fdesc/fdesc_vnops.c:575: warning: `error' may be used uninitialized in this function

initialize it to 0

../../../../miscfs/fdesc/fdesc_vnops.c: In function `fdesc_badop':
../../../../miscfs/fdesc/fdesc_vnops.c:1031: warning: control reaches end of non-void function

put a return(0) at the end (actually, I guess it could be void instead of int)

../../../../miscfs/fifofs/fifo_vnops.c: In function `fifo_badop':
../../../../miscfs/fifofs/fifo_vnops.c:539: warning: control reaches end of non-void function

put a return(0) at the end (actually, I guess it could be void instead of int)

../../../../miscfs/specfs/spec_vnops.c: In function `spec_read':
../../../../miscfs/specfs/spec_vnops.c:306: warning: control reaches end of non-void function

put a return(0) at the end

../../../../miscfs/specfs/spec_vnops.c: In function `spec_write':
../../../../miscfs/specfs/spec_vnops.c:392: warning: control reaches end of non-void function

put a return(0) at the end

../../../../miscfs/specfs/spec_vnops.c: In function `spec_ioctl':
../../../../miscfs/specfs/spec_vnops.c:432: warning: control reaches end of non-void function

put a return(0) at the end

../../../../miscfs/specfs/spec_vnops.c: In function `spec_close':
../../../../miscfs/specfs/spec_vnops.c:586: warning: `devclose' may be used uninitialized in this function
../../../../miscfs/specfs/spec_vnops.c:587: warning: `mode' may be used uninitialized in this function

add a return(0) after the panic in the switch..

../../../../miscfs/specfs/spec_vnops.c: In function `spec_badop':
../../../../miscfs/specfs/spec_vnops.c:737: warning: control reaches end of non-void function

put a return(0) at the end (actually, I guess it could be void instead of int)

../../../../ufs/ffs/ffs_alloc.c: In function `ffs_realloccg':
../../../../ufs/ffs/ffs_alloc.c:168: warning: `request' may be used uninitialized in this function

initialize it to 0

../../../../ufs/ffs/ffs_subr.c: In function `ffs_isblock':
../../../../ufs/ffs/ffs_subr.c:184: warning: control reaches end of non-void function

put a return(0) at the end

../../../../ufs/mfs/mfs_vnops.c: In function `mfs_badop':
../../../../ufs/mfs/mfs_vnops.c:349: warning: control reaches end of non-void function

put a return(0) at the end (actually, I guess it could be void instead of int)

../../../../vm/device_pager.c: In function `dev_pager_putpage':
../../../../vm/device_pager.c:329: warning: control reaches end of non-void function

put a return(0) at the end

../../../../arch/sparc/sparc/autoconf.c: In function `findzs':
../../../../arch/sparc/sparc/autoconf.c:1096: warning: control reaches end of non-void function

add a return(NULL) at the end of the function

../../../../arch/sparc/sparc/autoconf.c: In function `makememarr':
../../../../arch/sparc/sparc/autoconf.c:1110: warning: `mp' may be used uninitialized in this function
../../../../arch/sparc/sparc/autoconf.c:1112: warning: `prop' may be used uninitialized in this function

initialize them both to NULL

../../../../arch/sparc/sparc/trap.c: In function `trap':
../../../../arch/sparc/sparc/trap.c:257: warning: `p' may be used uninitialized in this function
../../../../arch/sparc/sparc/trap.c:260: warning: `sticks' may be used uninitialized in this function

initialize p to NULL and sticks to 0

../../../../../../compat/common/vfs_syscalls_43.c: In function `compat_43_sys_fstat':
../../../../../../compat/common/vfs_syscalls_43.c:210: warning: `error' may be used uninitialized in this function

initialize it to 0


>Audit-Trail:
>Unformatted: