[vlc-devel] [PATCH 09/12] network: io: Remove VLA usages

Rémi Denis-Courmont remi at remlab.net
Fri Dec 11 11:53:53 CET 2020


Hi,

If the ISO C committee, the Open Group, the LLVM project and/or GCC are moving to obsolete VLAs, then we should move away slowly and orderly. But I have no info that would point in that direction, and I don't think we should bend over backwards to substitute them.

When all is said and done, C11 adds a whole bunch of intrinsic concepts, but C99 is mostly just syntactic sugar for C89 VLAs are mostly syntactic sugar for fixed-length arrays. Still it's not always that straight forward to avoid.

I don't think the comparison with gets() is fair. gets() is wrong unless you can somehow trust that the input stream won't overflow the buffer. VLAs are wrong only if you can't trust that the variable size is reasonably small. And indeed gets() has been dropped from the standard.
-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20201211/a9ef2034/attachment.html>


More information about the vlc-devel mailing list