Recursive Functions (58)

35 Name: #!/usr/bin/anonymous : 2008-09-23 10:58 ID:Heaven

>>34 you're a fucking n00b. just shut the fuck up since you obviously haven't read shit about those languages god dammit.

> Taking the address-of a stack allocated variable (using &)

There are no stack allocated variables. There are automatic objects. You're wrong, since conceptually this doesn't allow for tail-call recursion;

You presumably have something like this in mind,
void foo(int *p) { int i; if(*p <= 0) return; i = *p - 1; foo(&i); }

Whether you realize it or not, there is an operation after foo(&i); (the destruction of 'i' that other functions depend on it), so technically, this is not tail-call.

> If you use alloca() (or a C99-variable-sized array)

alloca() is not standard. You fucking moron blockhead.
I'm curious, have you read the semantics of C99 vlas? You most likely invoke undefined behavior where you don't realize it.
Undefined behavior == broken code.
Broken code == the compiler/implementation is allowed to do anything.

> If you're using Visual C/C++ version 8.1 or earlier

Hint: VC is a piece of shit.

> If the number of arguments changes (sometimes!)

Explain.

> If it's an indirect function call

Again, explain.

> If any of the types change the ABI needed (int->float, etc)

Nonsense.

Tl;dr go read the fucking standards (ISO 9899:1999, ISO 14882:2003), then go read some CS documents on recursion. You fucking imbecilic piece of shit.

This thread has been closed. You cannot post in this thread any longer.