Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I find them very useful and they often make the code cleaner. A dynamic run-time bound for a buffer can also make the code safer. VLAs are only dangerous when implemented naively (allocated on the stack without stack probing).


>are only dangerous when implemented naively (allocated on the stack without stack probing).

That's how it's implemented in all the major compilers. Anyway, even a hypothetical heap-based implementation would be bad because there's no way to report allocation errors.


GCC has stack probing.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: