Subject: alloca in the kernel
To: None <port-macppc@netbsd.org, tech-kern@netbsd.org>
From: Lloyd Parkes <lloyd@must-have-coffee.gen.nz>
List: tech-kern
Date: 01/06/2002 14:54:03
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 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?

Cheers,
Lloyd