If my functions only use a few variables and never return, then I never need anything but stack memory, and overflow is simply garbage collection. Is this possible in C?
Name:
Anonymous2009-11-11 12:51
If you overflow your stack you're fucked. Maybe you meant function return instead?
I don't think you know what anything of what you've said actually means.
Name:
Anonymous2009-11-11 12:53
>>2
I'm only fucked if I still need to access the old values. But the point is that I don't... a function uses a few, then goes to the next function, which uses a few, etc. By the time the old values would be pushed out, I don't need them anymore.
Name:
Anonymous2009-11-11 12:55
>>4
If you overflow your stack the OS will kill your program dead.
Technically, a stack overflow will trigger an exception which can be handled, but this is not possible in ANSI C, however most C compilers(like MSVC) provide extensions for exception handling.
Name:
Anonymous2009-11-11 13:46
If you never return, what are you doing making function calls in the first place?
Maybe a giant nest of switches? Or do you need recursion? gotos? COMPUTED GOTOS? strfry()?