Subject: Re: kernel panic, tonight's sup
To: None <current-users@netbsd.org>
From: Patrick Welche <prlw1@cam.ac.uk>
List: current-users
Date: 11/14/1998 16:59:51
Patrick Welche wrote:
> 
> After today's sup - all OK again. Was that a new gcc I saw going in ?

Well, nearly OK - just tried a second i386 kernel and:

cc  -O2 -Werror -Wall -Wmissing-prototypes -Wstrict-prototypes -Wno-main -I. -I../../../../arch -I../../../.. -nostdinc -DDIAGNOSTIC -DIPFILTER_LOG -DFRENCH_KBD -DMAXUSERS=32 -D_KERNEL  -Di386  -c ../../../../kern/vfs_subr.c
../../../../kern/vfs_subr.c: In function `vfs_sysctl':
../../../../kern/vfs_subr.c:1474: storage size of `vfc' isn't known
../../../../kern/vfs_subr.c:1521: sizeof applied to an incomplete type
cc1: warnings being treated as errors
../../../../kern/vfs_subr.c:1474: warning: unused variable `vfc'

Yet:

1474:         struct vfsconf vfc;
1521:                     sizeof(struct vfsconf)));


/*      $NetBSD: vfs_subr.c,v 1.94 1998/11/13 20:15:32 thorpej Exp $    */
...
#include <sys/mount.h>
...

/usr/include/sys/mount.h (or /usr/src/sys/sys/mount.h):

#if defined(COMPAT_09) || defined(COMPAT_43) || defined(COMPAT_44)
   
/*
 * Filesystem configuration information. Not used by NetBSD, but
 * defined here to provide a compatible sysctl interface to Lite2.
 */
struct vfsconf {
        struct  vfsops *vfc_vfsops;     /* filesystem operations vector */
        char    vfc_name[MFSNAMELEN];   /* filesystem type name */
        int     vfc_typenum;            /* historic filesystem type number */
        int     vfc_refcount;           /* number mounted of this type */
        int     vfc_flags;              /* permanent flags */
        int     (*vfc_mountroot)(void); /* if != NULL, routine to mount root */
        struct  vfsconf *vfc_next;      /* next in list */
};

#endif

So the problem is:

src/sys/kern/vfs_subr.c makes use of struct vfsconf unconditionally,
but vfsconf is only declared conditionally on COMPAT_{09,43,44}.

Cheers,

Patrick