On Mon, Nov 23, 2009 at 10:57 PM, Zach Welch <z...@superlucidity.net> wrote:
> On Mon, 2009-11-23 at 22:22 +0100, Andreas Fritiofson wrote:
>> On Sun, Nov 22, 2009 at 12:42 PM, Øyvind Harboe <oyvind.har...@zylin.com> 
>> wrote:
>> > On Sun, Nov 22, 2009 at 11:04 AM, Andreas Fritiofson
>> > <andreas.fritiof...@gmail.com> wrote:
>> >> On Sun, Nov 22, 2009 at 9:51 AM, Øyvind Harboe <oyvind.har...@zylin.com> 
>> >> wrote:
>> >>> Do not use variable length arrays. Use malloc().
>> >>>
>> >>> If you use variable length arrays on the stack that messes with embedded
>> >>> / uCLinux hosts.
>> >>>
>> >>
>> >> Only if the embedded host uses a home directory path longer than what
>> >> will fit on the stack. Is this really a problem?
>> >
>> > Yes. Other programmers will copy and paste your code.
>> >
>> > We've got the code clean of dynamic arrays on the stack and we
>> > should keep it that way.
>> >
>>
>> Since C99 has been accepted as the project's language standard, I
>> think it is reasonable to expect that valid language constructs that
>> are still *not* acceptable by the project be clearly stated in the
>> Style Guide. Likewise if being optimized for embedded hosts is a
>> priority for the project as a whole. Rejecting even trivial patches on
>> the grounds of previously unspoken goals does not encourage developers
>> to contribute.
>
> If it makes you feel better, I think we have started using variable
> length arrays elsewhere in the code, but this is one place where I think
> it does make sense to keep things off the stack.

There are no sites where we use variable length arrays
in OpenOCD anymore according to stackcheck.pl.

I don't see a good reason to start now.




-- 
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to