Wherein I propose that C++ initialize all stack variables to zero, preventing ~10% of CVEs.

Cost: none.

🔗 wg21.link/P2723R0 🔗

@jfbastien I’ve seen reports on this change in multiple compilers and it never stops blowing my mind a bit that you sometimes see a perf win, despite it making some degree of sense.

Follow

@gsnedders @jfbastien

How does it make sense? I fail to see how this is not simply a very weird case of missed optimization, given that the compiler was free to compile the code into something that zero-initializes stack variables earlier anyway (because any use of them would be undefined behaviour).

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.