Subject: kern/34094: Kernel option KSTACK_CHECK_MAGIC doesn't build
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <jacereda@users.sourceforge.net>
List: netbsd-bugs
Date: 07/26/2006 23:10:00
>Number: 34094
>Category: kern
>Synopsis: Kernel option KSTACK_CHECK_MAGIC doesn't build
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: kern-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Jul 26 23:10:00 +0000 2006
>Originator: Jorge Acereda
>Release: NetBSD-current
>Organization:
>Environment:
>Description:
Building a kernel with option KSTACK_CHECK_MAGIC fails:
/home/jacereda/netbsd3.0-pegasos/tools/bin/powerpc--netbsd-gcc -mno-strict-align -msoft-float -Wa,-maltivec -ffreestanding -fno-zero-initialized-in-bss -g -O2 -Wreturn-type -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 -Dofppc=ofppc -I. -I/home/jacereda/netbsd3.0-pegasos/src/sys/../common/include -I/home/jacereda/netbsd3.0-pegasos/src/sys/arch -I/home/jacereda/netbsd3.0-pegasos/src/sys -nostdinc -DKERNBASE=0x400000 -DPEGASOS -DFIRMWORKSBUGS -DLKM -DDIAGNOSTIC -DDEBUG -DTRAP_PANICWAIT -DMAXUSERS=32 -D_KERNEL -D_KERNEL_OPT -I/home/jacereda/netbsd3.0-pegasos/src/sys/lib/libkern/../../../common/lib/libc/quad -I/home/jacereda/netbsd3.0-pegasos/src/sys/lib/libkern/../../../common/lib/libc/string -I/home/jacereda/netbsd3.0-pegasos/src/sys/lib/libkern/../../../common/lib/libc/arch/powerpc/string -c /home/jace
reda/netbsd3.0-pegasos/src/sys/kern/kern_proc.c
cc1: warnings being treated as errors
/home/jacereda/netbsd3.0-pegasos/src/sys/kern/kern_proc.c: In function 'kstack_check_magic':
/home/jacereda/netbsd3.0-pegasos/src/sys/kern/kern_proc.c:1172: warning: cast discards qualifiers from pointer target type
*** Failed target: kern_proc.o
>How-To-Repeat:
>Fix:
Index: kern/kern_proc.c
===================================================================
RCS file: /cvsroot/src/sys/kern/kern_proc.c,v
retrieving revision 1.92
diff -u -r1.92 kern_proc.c
--- kern/kern_proc.c 19 Jul 2006 21:11:37 -0000 1.92
+++ kern/kern_proc.c 26 Jul 2006 22:58:39 -0000
@@ -1169,7 +1169,7 @@
if (*ip != KSTACK_MAGIC)
break;
- stackleft = (caddr_t)ip - KSTACK_LOWEST_ADDR(l);
+ stackleft = ((const char *)ip) - (const char *)KSTACK_LOWEST_ADDR(l);
#endif /* __MACHINE_STACK_GROWS_UP */
if (kstackleftmin > stackleft) {