3 ms·
The article, most unfortunately, doesn't explain why anyone would want infinite loops to be UB in the first place. I found this explanation: https://www.open-st
by ameliaquining 8d ago
The article, most unfortunately, doesn't explain why anyone would want infinite loops to be UB in the first place. I found this explanation: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1528.htm https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1528.htm
- omoikane 8d agoThe article mentions it's a halt-on-error pattern: https://www.sandordargo.com/blog/2026/09/16/cpp26-trivial-infinite-loops#:~:text=But%20why%20would%20anyone%20write%20while%20(true)%3B%20in%20the%20first%20place%3F https://www.sandordargo.com/blog/2026/09/16/cpp26-trivial-in... Edit: sorry, missed the UB bit.
- rcxdude 8d agoThat's more why you would want them to be defined in the first place.
- Lvl999Noob 8d agoThat says why they don't want it to be UB. The question, I believe, was why they want statically-known-infinite non-trivial loops to continue being UB.
- pseudohadamard 7d agoOne minor nit, it's not halt-on-error, it's restart-on-error since the watchdog then restarts the system. The technical term for this is rejuvenation and it's standard practice in SCADA and similar to deal with this-shouldn't-happen error conditions.
- layer8 8d agoSee https://news.ycombinator.com/item?id=49760653 https://news.ycombinator.com/item?id=49760653.