1 hour ago · Tech · hide · 0 comments

Let’s start with a question! Is this program well-defined? int main() { while (true) ; } If you said yes, you’d be wrong — at least before C++26. A while (true); loop with no side effects used to be undefined behaviour. Compilers were free to assume it terminates, and some — Clang in particular — would optimize it away entirely, with spectacular consequences: // https://godbolt....

No comments yet. Log in to reply on the Fediverse. Comments will appear here.