C++26: Trivial infinite loops are no longer undefined behaviour
Thread
Unofficial Hacker News client; not affiliated with Y Combinator.
C++26: Trivial infinite loops are no longer undefined behaviour
Unofficial Hacker News client; not affiliated with Y Combinator.
Aurornis · · focus · HN ↗
mathisfun123 · · focus · HN ↗
it's actually probably the most common footgun you'll encounter in practice: non-void functions with no return statements just keep executing past their end. ask me how i know.
compile with -Wreturn-type if you want to avoid such things...
mitxela · · focus · HN ↗
mathisfun123 · · focus · HN ↗
mitxela · · focus · HN ↗