From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Meissner To: Nick Duffek Cc: meissner@cygnus.com, gdb@sources.redhat.com Subject: Re: alloca is bad? Date: Tue, 14 Nov 2000 06:37:00 -0000 Message-id: <20001114093702.32186@cse.cygnus.com> References: <20001113152141.07868@cse.cygnus.com> <200011132129.eADLTfJ17017@rtl.cygnus.com> X-SW-Source: 2000-11/msg00146.html On Mon, Nov 13, 2000 at 04:29:41PM -0500, Nick Duffek wrote: > On 13-Nov-2000, Michael Meissner wrote: > > >That won't work, since alloca is a builtin provided by GCC. > > That can be disabled by compiling with -fno-builtin. It isn't as simple as that with GNU software, which generally has code like the following in an include file: #if defined(__GNUC__) && !defined(C_ALLOCA) # ifndef alloca # define alloca __builtin_alloca # endif #else /* ! defined (__GNUC__) */ (ie, if the compiler is GCC always use the builtin function). You probably also need to rebuild the whole app, and not just relink it. > >If GCC is detected as the compiler at configuration time, then alloca is > >not even built into libiberty. > > True, but that's easy to circumvent. > > Using -lefence or other debugging mallocs to debug alloca overruns isn't > as easy as a simple relink, but it doesn't seem fundamentally difficult. > > Nick -- Michael Meissner, Red Hat, Inc. PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886, USA Work: meissner@redhat.com phone: +1 978-486-9304 Non-work: meissner@spectacle-pond.org fax: +1 978-692-4482