Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Build failure - port amd64 - sys/kern/subr_autoconf.c

On Wed, 5 Mar 2008, Paul Goyette wrote:

From sources updated on 2008-03-05 at 12:21:24 UTC

#   compile  ZIPPY/subr_autoconf.o
/usr/obj/tooldir/x86_64/amd64/bin/x86_64--netbsd-gcc -mcmodel=kernel -mno-red-zone -ffreestanding -fno-zero-initialized-in-bss -g -O2 -fno-omit-frame-pointer -std=gnu99 -Werror -Wall -Wno-main -Wno-format-zero-length -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wno-sign-compare -Wno-pointer-sign -Wno-attributes -fno-strict-aliasing -Werror -Wall -Wno-main -Wno-format-zero-length -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wno-sign-compare -Wno-pointer-sign -Wno-attributes -Werror -Damd64 -Dx86_64 -I. -I/build/src/sys/../common/include -I/build/src/sys/arch -I/build/src/sys -nostdinc -DLKM -DDIAGNOSTIC -DMAXUSERS=64 -D_KERNEL -D_KERNEL_OPT -I/build/src/sys/lib/libkern/../../../common/lib/libc/quad -I/build/src/sys/lib/libkern/../../../common/lib/libc/string -I/build/src/sys/lib/libkern/../../../common/lib/libc/arch/x86_64/string -I/build/src/sys/dist/ipf -c /build/src/sys/kern/subr_autoconf.c
cc1: warnings being treated as errors
/build/src/sys/kern/subr_autoconf.c: In function 'deviter_init':
/build/src/sys/kern/subr_autoconf.c:2255: warning: 'rw' is used uninitialized in this function
1 error

This is a custom kernel config, but there's really nothing special about it. It's just a very stripped-down version of GENERIC. The config file is attached to this message just in case it does make a difference.

The following patch should take care of this error:

Index: subr_autoconf.c
RCS file: /cvsroot/src/sys/kern/subr_autoconf.c,v
retrieving revision 1.136
diff -u -p -r1.136 subr_autoconf.c
--- subr_autoconf.c     5 Mar 2008 07:09:18 -0000       1.136
+++ subr_autoconf.c     5 Mar 2008 14:03:18 -0000
@@ -2250,7 +2250,7 @@ void
 deviter_init(deviter_t *di, deviter_flags_t flags)
        device_t dv;
-       bool rw;
+       bool rw = (flags & (DEVITER_F_RW | DEVITER_F_SHUTDOWN)) != 0;

        KASSERT(!rw || curlwp != NULL);

Note that I've initialized rw based on both the RW and SHUTDOWN flags since the comments state that SHUTDOWN implies RW.

|   Paul Goyette   | PGP DSS Key fingerprint: |  E-mail addresses:   |
| Customer Service | FA29 0E3B 35AF E8AE 6651 |   |
| Network Engineer | 0786 F758 55DE 53BA 7731 | |

Home | Main Index | Thread Index | Old Index