This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: alloca is bad?


On Sat, Nov 11, 2000 at 04:27:29PM +1100, Andrew Cagney wrote:
>Chris Faylor wrote:
>> On Fri, Nov 10, 2000 at 05:39:29AM -0500, Eli Zaretskii wrote:
>>>>Date: Thu, 9 Nov 2000 21:20:32 -0500
>>>>From: Christopher Faylor <cgf@redhat.com>
>>>>
>>>>I was surprised by this assertion and so I thought I'd ask for a
>>>>consensus here.  Should the use of alloca be deprecated in gdb?
>>>
>>>In my experience, there's nothing wrong with alloca as long as it is
>>>used for allocating small buffers.  The only consideration is that not
>>>every platform supports alloca.
>> 
>>But, since alloca is already entrenched in gdb and available in liberty
>>I don't think this is an issue, is it?
>
>There are a many entrenched practices in GDB and many of those we don't
>want to perpetuate.  Typically, these were either viewed as innocent
>short-cuts or simply as good ideas.  In hindsight (we've 15 years worth
>now :-) these practices turned out to be somewhat misguided.  Part of
>our penance is that on-going maintenance expense we incur when ever we
>touch the code.
>
>Consider Peter S's example as a case in point - it looked harmless :-)

I don't think that the fact that you can cut yourself with a knife means
that you eliminate all sharp objects from your premises.

YMMV,
cgf

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]