Subject: Re: problems building -current
To: NetBSD Current Users <current-users@netbsd.org>
From: Barry Bouwsma <freebsd-misuser@remove-NOSPAM-to-reply.NOSPAM.dyndns.dk>
List: current-users
Date: 01/11/2005 02:19:50
Steven M. Bellovin wrote:

> >>I'm doing a 'make release'; on the INSTALL kernels, I'm getting this
> >>error:

> >>#   compile  INSTALL/ext2fs_vfsops.o
> >>cc -ffreestanding -Os -Werror -Wall -Wno-main -Wno-format-zero-length -Wpoint
> >er-arith -Wmissing-prototypes -Wstrict-prototypes -Wno-sign-compare -fno-zero-
> >initialized-in-bss -Di386 -I. -I/usr/src/sys/arch -I/usr/src/sys -nostdinc -DM
> >ALLOC_NOINLINE -DMAXUSERS=32 -D_KERNEL -D_KERNEL_OPT -c /usr/src/sys/ufs/ext2f
> >s/ext2fs_vfsops.c
> >>/usr/src/sys/ufs/ext2fs/ext2fs_vfsops.c: In function `ext2fs_mount':
> >>/usr/src/sys/ufs/ext2fs/ext2fs_vfsops.c:252: warning: `devvp' might be used u
> >ninitialized in this function

> >>not obvious to me why the complier thinks that devvp might be
> >>uninitialized, though that may just be the limits of the compiler's
> >>flow analysis ability.  

> >For what it's worth, "me too!".  Would it be worthwhile to just 
> >initialize it to NULL simply to work around the problem, or does someone 

> Without understanding the problem more, I'm extremely reluctant to do 
> that.  In particular, when I looked at the code I saw absolutely 
> nothing that looked to be conditional on an INSTALL kernel vs. a 
> GENERIC, which makes me think that the real problem is elsewhere.

Would this:
> >>cc -ffreestanding -Os -Werror -Wall -Wno-main -Wno-format-zero-length -Wpoint
                      ^^^
make any difference?  I happened to set `-O1' on my i386 build and
ran into this type of problem with three source files in GENERIC,
one ext2fs file ext2fs_readwrite.c which is not the same one you
noticed.  In all cases, looking much more closely at the source,
it would be the difference between the default -O2 successful setting,
and the problem -O1, which made the difference whether the compiler
really would notice if there would be a case when the allegedly
uninitialized variable really would not be initialized (it wouldn't,
but for the lower -O1 optimization, apparently the compiler wasn't
able to figure that out).

I needed to patch three files to be able to use -O1; none of those
patches were needed for -O2, the default.


Forgive me if I'm spouting nonsense -- I can't claim to understand
what's going on, so I haven't followed up with the patches (same as
I had encountered months back, for the same reason).  And I really
would like to learn.


thanks
barry bouwsma