Subject: kern/33212: unused variable `l' in compat/mach/mach_vm.c
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <kiyohara@kk.iij4u.or.jp>
List: netbsd-bugs
Date: 04/07/2006 02:35:01
>Number:         33212
>Category:       kern
>Synopsis:       unused variable `l' in compat/mach/mach_vm.c
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Apr 07 02:35:00 +0000 2006
>Originator:     KIYOHARA Takashi
>Release:        NetBSD/i386 3.99.17
>Organization:
>Environment:
NetBSD highpriestess.fool 3.99.17 NetBSD 3.99.17 (HIGHPRIESTESS) #0: Tue Mar 28 11:39:04 JST 2006  lance@highpriestess.fool:/sys/arch/i386/compile/HIGHPRIESTESS i386

>Description:
netbsd kernel fail to compile, becouse unused variable `l'.


#   compile  HIEROPHANT/mach_vm.o
/usr/src/cross/powerpc/bin/powerpc--netbsd-gcc -mno-strict-align -msoft-float -Wa,-maltivec -ffreestanding -O2 -Wreturn-type -Werror -Wall -Wno-main -Wno-format -zero-length -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wno-sign-compare -fno-zero-initialized-in-bss -Dmacppc=macppc -I. -I../../../../arch -I../../../.. -nostdinc -DMAXUSERS=32 -D_KERNEL -D_KERNEL_OPT -I../../../../lib/libkern/../../../common/
lib/libc/quad -I../../../../lib/libkern/../../../common/lib/libc/string -I../../../../lib/libkern/../../../common/lib/libc/arch/powerpc/string -c ../../../../compat/mach/mach_vm.c
../../../../compat/mach/mach_vm.c: In function `mach_vm_write':
../../../../compat/mach/mach_vm.c:806: warning: unused variable `l'

*** Failed target:  mach_vm.o
*** Failed command: echo '# ' "compile HIEROPHANT/mach_vm.o"; echo /usr/src/cross/powerpc/bin/powerpc--netbsd-gcc -mno-strict-align -msoft-float -Wa,-maltivec -ffreestanding -O2 -Wreturn-type -Werror -Wall -Wno-main -Wno-format-zero-length
-Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wno-sign-compare -fno-zero-initialized-in-bss -Dmacppc=macppc -I. -I../../../../arch -I../../../.. -nostdinc -DMAXUSERS=32 -D_KERNEL -D_KERNEL_OPT -I../../../../lib/libkern/../../../common/lib/libc/quad
 -I../../../../lib/libkern/../../../common/lib/libc/string -I../../../../lib/libkern/../../../common/lib/libc/arch/powerpc/string -c ../../../../compat/mach/mach_vm.c; /usr/src/cross/powerpc/bin/powerpc--netbsd-gcc -mno-strict-align -msoft-float -Wa,-maltivec -ffreestanding -O2 -Wreturn-type -Werror -Wall -Wno-main -Wno-format-zero-length -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wno-sign-compare -fno-zero-initialized-in-bss -Dmacppc=macppc -I. -I../../../../arch -I../../../.. -nostdinc -DMAXUSERS=32 -D_KERNEL -D_KERNEL_OPT -I../../../../lib/libkern/../../../common/lib/libc/quad -I../../../../lib/libkern/../../../common/lib/libc/string 
-I../../../../lib/libkern/../../../common/lib/libc/arch/powerpc/string -c ../../../../compat/mach/mach_vm.c
*** Error code 1

Stop.
nbmake: stopped in /usr/src/sys/arch/macppc/compile/HIEROPHANT

>How-To-Repeat:
You try make your netbsd kernel for macppc.  before configure uncomment out options COMPAT_MACH and comment out options KTRACE.
>Fix:
Index: sys/compat/mach/mach_vm.c
===================================================================
RCS file: /cvsroot/src/sys/compat/mach/mach_vm.c,v
retrieving revision 1.49
diff -u -r1.49 mach_vm.c
--- sys/compat/mach/mach_vm.c   11 Dec 2005 12:20:20 -0000      1.49
+++ sys/compat/mach/mach_vm.c   27 Mar 2006 18:21:02 -0000
@@ -803,7 +803,9 @@
        mach_vm_write_request_t *req = args->smsg;
        mach_vm_write_reply_t *rep = args->rmsg;
        size_t *msglen = args->rsize;
+#ifdef KTRACE
        struct lwp *l = args->l;
+#endif
        struct lwp *tl = args->tl;
        size_t size;
        void *addr;