How can I prevent GCC from optimizing out a busy wait loop?
I developed this answer after following a link from dmckee’s answer, but it takes a different approach than his/her answer. Function Attributes documentation from GCC mentions: noinline This function attribute prevents a function from being considered for inlining. If the function does not have side-effects, there are optimizations other than inlining that causes function calls … Read more