3 ms·
They're universally regarded as a dangerous, difficult to use feature (yes, even by C programmers) and are no longer required in C11. VLAs can have nasty side e
by AlotOfReading 8y ago
They're universally regarded as a dangerous, difficult to use feature (yes, even by C programmers) and are no longer required in C11. VLAs can have nasty side effects like stack corruption and are a leaky abstraction at best. You can't expose a VLA's size through the ABI, for instance.
- codys 8y ago> You can't expose a VLA's size through the ABI, for instance. Can you clarify what you mean by this? It's not clear to me what it would even mean to expose a VLA in the ABI: they are function scoped and as a result it doesn't seem like they could escape to the ABI.
- AlotOfReading 8y agoGCC added an extension years back that allows VLAs as struct members and function arguments. Clang had the good sense not to, thankfully.
- codys 8y agoCan you provide a reference to both of those affecting _ABI_? "VLAs as [...] function arguments" sounds like it would just be normal passing of arrays. It's not clear that VLAs have any effect here. "VLAs as struct members [...]" is still not clearly an ABI issue: if they existed, the types would still be confined to the function they are declared in, and thus would not affect ABI.