Subject: re: alloca in the kernel
To: Lloyd Parkes <email@example.com>
From: matthew green <firstname.lastname@example.org>
Date: 01/06/2002 13:00:33
Line 227 of sys/arch/macppc/macppc/machdep.c reads 'ofmap =
alloca(ofmaplen);', which in turn causes
cc1: warnings being treated as errors
/vol/NetBSD/build/src/sys/arch/macppc/macppc/machdep.c: In function `initppc':
/vol/NetBSD/build/src/sys/arch/macppc/macppc/machdep.c:227: warning: implicit
declaration of function `alloca'
assignment makes pointer from integer without a cast
*** Error code 1
when cross compiling using build.sh on NetBSD/i386. This is all with -current.
I have checked, and this is the only use of alloca in any kernel code in any
NetBSD port. Should it be replaced with malloc/free?
does this file include libkern.h? alloca() recently moved to being
a GCC builtin #define, and we use cc -ffreestanding, and files using
alloca() need to include libkern.h.