The reason for stack overflow is because stack space runs out, but what if functions have no parameters so that no data has to be pushed onto the stack? That still leaves pushing the "return" address, but in a case of intended infinite recursion that would be unnecessary.
So what I am asking I guess is... whether it is possible to use some kind of calling convention that the call doesn't put anything on the stack and just jumps to the first instruction and executes and provided that the final instruction will be another call to a function until ultimately execution is terminated? Ideally, if this can be implemented with function pointers and dynamic linking?
Just to specify, I am referring to a function that takes a single parameter and returns nothing, so technically fastcall will suffice, but it still preserves an address to return to, which will eventually lead to overflow. Can this be prevented in some way?
Another important point I failed to mention earlier, I don't mean recursion of a single function, e.g. where the state is static and is being reused, I mean recursion from one arbitrary function into another.