Toot
Written by Urix Turing on 2024-09-19 at 14:40
The answer is:
- C++: an infinite loop with no side effects is undefined behavior (an infinite loop with side effects is valid). The practical effect depends on the compiler, which may (-O0) or may not (-O3) keep the loop, but essentially it will build.
- Rust: this is a totally valid program and will just loop forever. Interestingly, an infinite loop can be assigned to the ! type.
I'm with Rust on this one, the fact that an infinite loop can be optimized away is crazy...
=> More informations about this toot | View the thread | More toots from urixturing@hachyderm.io
Mentions
Tags
Proxy Information
- Original URL
- gemini://mastogem.picasoft.net/toot/113164734749372900
- Status Code
- Success (20)
- Meta
text/gemini
- Capsule Response Time
- 229.877883 milliseconds
- Gemini-to-HTML Time
- 0.863927 milliseconds
This content has been proxied by September (ba2dc).