Hacker News new | ask | show | jobs
by ynfnehf 1420 days ago
This usage of VLAs is once again mandatory for compilers to support, since C23. From Wikipedia: "Variably-modified types (but not VLAs which are automatic variables allocated on the stack) become a mandatory feature".
1 comments

Oh well...
At least it is still optional to allow for stack allocated VLAs. Which is the attack vector you mentioned.
Tell me, what’s wrong with variably modified types specifically?
Sizeof, which used to be one of the very few things you could blindly do to an arbitrary (potentially UB-provoking) expression, can now have side effects.