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: [RFA] alloca coding standard


On Wed, Nov 15, 2000 at 06:20:47AM -0500, Eli Zaretskii wrote:
>> Date: Mon, 13 Nov 2000 16:24:49 -0500
>> From: Nick Duffek <nsd@redhat.com>
>> 
>> On 13-Nov-2000, Kevin Buettner wrote:
>> 
>> >I think we ought to just pick a number (in bytes) and not mention
>> >pages at all.  
>> 
>> I agree.  I'll rework the patch to specify 512 bytes or whatever number
>> the group thinks is reasonable.
>
>I think 512 bytes is too restricting. 1K or even 2K should not harm
>anything.  (My criterion is the maximum size of an automatic array
>that I would use without too much hesitation.)

In my particular patch, which started all of this, I essentially did a
"strdup" of the gdb command from a 'thread apply'.  In this case, there
is no way that you can guarantee that the command will be any length,
even though it is unlikely to reach 2K.

Does this kind of situation need to be spelled out?  I'm beginning to
think that Jim Blandy's point of view is corret.  If we decide that
alloca is acceptable maybe we just need to document all of its pitfalls
and leave the rest to the intelligence of the programmer.

cgf

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