Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
lelanthran
12 hours ago
|
parent
|
context
|
favorite
| on:
Some C habits I employ for the modern day
> 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.
apaprocki
12 hours ago
[–]
`-Wvla` Friends don’t let friends VLA :)
reply
uecker
8 hours ago
|
parent
[–]
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.
reply
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
And if it doesn't, VLAs are still in there until C23, IIRC.