[vlc-devel] [PATCH 09/12] network: io: Remove VLA usages
Steve Lhomme
robux4 at ycbcr.xyz
Thu Dec 10 08:11:25 CET 2020
On 2020-12-09 17:30, Rémi Denis-Courmont wrote:
> Le mercredi 9 décembre 2020, 12:17:27 EET Hugo Beauzée-Luyssen a écrit :
>> On Wed, Dec 9, 2020, at 10:31 AM, Rémi Denis-Courmont wrote:
>>> VLA are required just like hosting and threads and atomics are
>>> required. By VLC, and in the case of VLAs also by C99.
>>
>> It's a de-facto requirement because the code uses it, but I don't think
>> there's a clear & hard requirement, and it seems fairly easy to remove.
>
> It's a requirement de facto and de jure. Before VLAs we were using alloca().
> We switched to VLAs as part of the switch to C99.
>
>> It's indeed required by C99 but that's irrelevant since we don't use C99.
>>> None of those are required by C11 and that's completely irrelevant, as
>>> VLC is not meant to run on bare metal or historical ISAs.
>>
>> Yes, but we're not talking about running on those architecture AFAICS
>
> Yes, so the fact that some parts of C11 are optional or platform-dependent is
> irrelevant. VLC is not meant to run on a microcontroller that lacks the memory
> or registers to support VLAs or threads, and for which those parts of the
> specification were made optional.
We could very well support MSVC (again) now that they support all
mandatory C11 features [1]. They are going to add thread/atomics "soon".
But VLA is not on the horizon for pragmatic reasons [2].
This no microcontroller/short on memory platform support.
With Meson support also possible it might be soon very easy for windows
developers to just generate the Visual Studio project and build VLC from
there. The more compiler we support, the better. They often find
different errors.
[1]
https://devblogs.microsoft.com/cppblog/c11-and-c17-standard-support-arriving-in-msvc/#whats-not
[2]
https://devblogs.microsoft.com/cppblog/c11-and-c17-standard-support-arriving-in-msvc/#variable-length-arrays
More information about the vlc-devel
mailing list