Subject: kern/33211: unused variable `p' in compat/mach/mach_message.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:15:00
>Number:         33211
>Category:       kern
>Synopsis:       unused variable `p' in compat/mach/mach_message.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:15: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 `p'.


#   compile  HIEROPHANT/mach_message.o
/usr/src/cross/powerpc/bin/powerpc--netbsd-gcc -mno-strict-align -msoft-float -W
a,-maltivec -ffreestanding -O2 -Wreturn-type -Werror -Wall -Wno-main -Wno-format
-zero-length -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wreturn-t
ype -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wno-sign-compare -fno-zero-in
itialized-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 ../../../../co
mpat/mach/mach_message.c
../../../../compat/mach/mach_message.c: In function `mach_msg_recv':
../../../../compat/mach/mach_message.c:429: warning: unused variable `p'

*** Failed target:  mach_message.o
*** Failed command: echo '# ' "compile HIEROPHANT/mach_message.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_message.c; /usr/src/cross/powerpc/bin/powerpc--netbsd-gcc -mno-strict-ali
gn -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_message.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.
>Fix:
Index: sys/compat/mach/mach_message.c
===================================================================
RCS file: /cvsroot/src/sys/compat/mach/mach_message.c,v
retrieving revision 1.47
diff -u -r1.47 mach_message.c
--- sys/compat/mach/mach_message.c      11 Dec 2005 12:20:20 -0000      1.47
+++ sys/compat/mach/mach_message.c      27 Mar 2006 18:21:01 -0000
@@ -426,7 +426,9 @@
        mach_port_t mn;
 {
        struct mach_port *mp;
+#ifdef DEBUG_MACH_MSG
        struct proc *p = l->l_proc;
+#endif
        struct mach_message *mm;
        mach_port_t tmp;
        struct mach_right *cmr;