logoalt Hacker News

1718627440yesterday at 10:04 AM1 replyview on HN

That's only true in C++ though, not in C.


Replies

dzaimayesterday at 10:21 AM

C does allow unconditional infinite loops (e.g. "while (1) { }" isn't UB) but still is UB if the controlling expression isn't constant (e.g. "while (two < 10) { }" is UB if two is a variable less than 10)