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

I would rather prefer the compiler to tell me: "Hey, this stack-allocated variable is escaping the function's scope, I can't do that! Allocate it somewhere outside the stack."

Maybe the compiler could offer me a simple way to fix the declaration somehow. But being explicit and transparent here feels important to me; if I wanted to second-guess the compiler and meditate over disassembly, I could pick C++.



Since HN upvotes are invisible in the UI: +1. IMHO escaped locals should be an error, but not a hidden allocation.




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

Search: