3 ms·
VLAs have been deprecated, alloca was never part of a C standard AFAIK. I was not suggesting that any of both is a good idea - but they are tools 'for program
by rkta 3y ago
VLAs have been deprecated, alloca was never part of a C standard AFAIK.
I was not suggesting that any of both is a good idea - but they are tools
'for programs where the amount of items you must store is only known at run time.' (Assuming that not having to free is considered "automatic memory management").
- mort96 3y agoDeprecated? I thought they were only made optional?
- pjmlp 3y agoWhich allows any compiler that never implemented C99 to be certified as compliant on later standards (C11, C17, C23), thus yielding the same outcome in practice.
- mort96 3y agoThe status of VLAs is officially the exact same as the status of 'uint32_t' and the like, so I think it's fair to say there's a significant difference between something being optional (a la uint32_t) and something being deprecated (a la gets). But I agree, in practice, the change to VLAs feels more deprecation-like, because they got demoted to optional because everyone more or less recognised that they're a bad idea, I don't imagine GCC will remove it any time soon but I wouldn't be surprised if it got options to disable them and if those options eventually became enabled by default.
- rkta 3y agoCorrect, they are optional, not deprecated. That was sloppy on my side.