[ prog / sol / mona ]

prog


Inalienable Core of "Practical" Programming Languages

9 2021-11-03 14:17

>>8

At the very least because it's hard (impossible) to predict what the compiler will make from it. Having a VLA means having some data of unknown (at compile time) size on the stack. Unknown at compile time means there might be (and depending on the amount of VLAs and structure of surrounding code will be quite a bit) of runtime calculations needed to figure out where the fuck things are located in memory. You are almost always better off to just have an array of "sufficient" size and throw an error in case of bounds being violated. For longtime allocations there is obviously malloc and friends anyways.

23


VIP:

do not edit these