On 21 October 2014 16:17, Pär Karlsson <[email protected]> wrote:
> Yes, you are right, of course. Looking through the original implementation
> again, it seems water tight. clang probably complains about the
> uninitialized values above argcount in saved_lengths[], that are never
> reached.
>
> The precalculated strlen:s saved is likely only an optimization(?) attempt,
> I suppose.

Yes. Grepping through the code shows that currently there is no
invocation of concat_strings() having more than 5 arguments.

>
> Still, it seems wasteful to set up two complete loops with va_arg, and
> considering what this function actually does, I wonder if not s(n)printf
> should be used instead of this function? :-)

I think concat_strings() is more tight and readable than multiple
strlen() + malloc() + snprintf().

Regards.

               yousong

Reply via email to