[vlc-devel] [PATCH 05/12] Replace variable-length arrays by calls to alloca() for C90 compliance.

Felix Abecassis felix.abecassis at gmail.com
Mon Dec 2 10:45:21 CET 2013


2013/11/30 Rémi Denis-Courmont <remi at remlab.net>:
> Le samedi 30 novembre 2013, 15:59:19 Felix Abecassis a écrit :
>> C89 and C90 are the same.
>> VLAs were added in C99 so removing them actually helps C89/C90 compliance.
>
> That's not true. alloca() is not in C89, even if you want to call it C90. It
> is non-standard and thus using it cannot help standard compliance.
I meant: not using VLAs helps C89/C90 compliance.

> alloca() is _not_ in C11, and is not supported by all _conforming_ compilers.
You are right, but we might achieve better portability by using
alloca() instead of VLAs; even if it is not standard.

> Worst yet, alloca() does not an equivalent or a superset of VLAs functionally
> speaking.

> And relatively speaking, alloca() is far worse than VLAs.
Could you elaborate on that? Why is it worse than VLAs?

-- 
Félix Abecassis
http://felix.abecassis.me



More information about the vlc-devel mailing list