Few things have made me more nervous in my career than seeing a ISR making use of C++ standard library features. When I asked the engineer how they were sure this was safe and worked under the covers, I was immediately dismissed as "the compiler takes care of all that." The project only ever worked at -O0 and was still buggy. The engineer blamed the hardware.
Could you elaborate on this? I thought at least speculative execution was handled internally in the CPU and essentially not visible to the user apart from the performance impact?
I’m not sure what you refer to as out-of-order execution, is this execution reordering within the C compiler?
> If you throw in interrupts or threads, you know you must tread cautiously in C.
Naturally, yes.