Subject: re: alloca in the kernel
To: Lloyd Parkes <>
From: matthew green <>
List: tech-kern
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'
   	/vol/NetBSD/build/src/sys/arch/macppc/macppc/machdep.c:227: warning: 
   assignment makes pointer from integer without a cast
   	*** Error code 1
   when cross compiling using 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.