26

What the hell was I thinking at when I wrote this nice interface wrapper...

What bothers me more is that gcc didn't warned me about such obvious recursion...

Comments
  • 5
    Why would GCC warn? It doesn't warn at while (1) either, nor at foo: goto foo;. Though if GCC is nice, it will apply tail call optimisation to your recursion. ^^
  • 0
    Self referential functions aren't an error of any kind. But they should be pretty easy to spot when your CPU usage goes to 100%
  • 0
    Not entirely true. while(1); will not create stack overflow, this does. And in my case it was in embedded Cortex-M so it happily ended in HardFault after stack overflow without any trace.

    Yes, it is obvious once you notice it but tracing it takes a while.
Add Comment