Unfortunate. There isn't ever a good reason to have an infinite loop so concerned compilers could have just diagnosed this as a warning.
> There isn't ever a good reason to have an infinite loop
That seems to be a very broad statement. For example in a system where interrupts mostly control things this sort of 'do not close the program' could be useful.
A guy I worked with had one I never would think of because I do not work in that field.
But yeah a warning would probably be useful.
Interrupt driven super loops are very common on bare metal systems.
Compilers can still diagnose something as a warning even if it's not UB.
For Rust the infinite loop is important enough to have its own keyword.
The article mentions a use case for that:
> What I found is that this is common in embedded and kernel code as a halt-on-error pattern. When a fatal error occurs and there’s no operating system to exit to, you simply stop: