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

Luca Barbato lu_zero at gentoo.org
Mon Dec 2 13:43:46 CET 2013


On 02/12/13 10:45, Felix Abecassis wrote:
>> 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?
> 

Alloca and VLAs are a terrible idea to use in anything that should be
robust since it is by itself an undefined behaviour (crash) waiting to
happen at the worst time.

lu



More information about the vlc-devel mailing list