[vlc-devel] [PATCH 05/12] Replace variable-length arrays by calls to alloca() for C90 compliance.
Rémi Denis-Courmont
remi at remlab.net
Sun Dec 1 18:25:56 CET 2013
Le dimanche 1 décembre 2013, 16:56:31 Jean-Baptiste Kempf a écrit :
> On 30 Nov, Rémi Denis-Courmont wrote :
> > VLC is C99 code (plus some easy to backport C11 features). Use a C99-
> > compatible compiler.
>
> This is true. However, VLA are now optional in C11,
Threads and atomic variables are also optional in C11. Most importantly the 8-
bits variables and the hosted library are optional in C99 and C11. And yet VLC
needs them. Indeed it might make sense for some deeply embedded compilers to
do away with these features; but that is totally irrelevant.
> and I'm afraid MSVC will not supports that ever.
alloca() is _not_ in C11, and is not supported by all _conforming_ compilers.
Worst yet, alloca() does not an equivalent or a superset of VLAs functionally
speaking.
Even in the school case that there was an acceptable replacement, distributing
(Lib)VLC binaries compiled with MSVC violates my copyrights so I could not
care less about being compatible with it.
> The rest of C99 is now almost supported, as this patch series shows.
> On a lighter note, Mans would say: "VLA are evil" [1]
It would not be the only point of disagreement. And relatively speaking,
alloca() is far worse than VLAs.
--
Rémi Denis-Courmont
http://www.remlab.net/
More information about the vlc-devel
mailing list