I cant say what is wrong here but surely it cant be what it claims to be. I remember reading that amiga functions use very little stack.
From my understanding of C so far all of the local variables that arent "static" are put on the stack and also the stack is used to store where the program is up to when you call a function.
Maybe something is overwriting something it shouldnt and you are getting misleading errors?