Y
Hacker News
new
|
ask
|
show
|
jobs
by
lelanthran
150 days ago
> You can allocate dynamically on the stack in C as well. Every compiler will give you some form of alloca().
And if it doesn't, VLAs are still in there until C23, IIRC.
1 comments
apaprocki
150 days ago
`-Wvla` Friends don’t let friends VLA :)
link
uecker
150 days ago
alloca is certainly worse. Worst-case fixed size array on the stack are also worse. If you need variable-sized array on the stack, VLAs are the best alternative. Also many other languages such as Ada have them.
link