3 ms·
It's quite common in embedded systems to have the fault handler end with an infinite loop, to give the programmer a chance to attach a debugger an inspect the c
by TorKlingberg 10y ago
It's quite common in embedded systems to have the fault handler end with an infinite loop, to give the programmer a chance to attach a debugger an inspect the call stack. Sometimes this behavior is turned on or off with a debug flag, which can trigger this unexpected optimization if the flag is not a compile time constant.
- planteen 10y agoYou could also add a volatile declaration
- boomlinde 10y agoYou could always say if (flag) while (1);
- TorKlingberg 10y agoYes, that would make more sense. I have never seen this optimization actually bite anyone.
- pcvarmint 10y agoA halt instruction (HLT on x86) might also work.