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.

With that said, I'll happily resign in this case. Actually, my first
draft was using asprintf() but I rejected it for not being standard.
Seeing there's an equivalent already in the code, I'll update the
patch using that.

However, alloc_vprintf() seems to have a rather cumbersome
implementation. Is there a reason why it is looping, trying with
increasingly larger allocations?

/Andreas
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to