[gclist] tail-calls in C/C++

Fergus Henderson fjh@cs.mu.OZ.AU
Thu, 8 Aug 1996 01:48:26 +1000 (EST)


Nick Barnes, you wrote:
> 
> > > Thus A can call B with more arguments (and hence locations on the
> > > stack) than the number expected by B.
> > 
> > For standard-conforming programs, this problem only arises
> > in the case when B uses `...'.  It's easy enough to not
> > perform the optimization in that case.
> 
> Nope. The standard admits non-prototyped functions.

Yes, but you're not allowed to pass more arguments than
the function has.

For example, the following program has undefined behaviour.

	int main() {
		g(1);
	}
	void g() {}

-- 
Fergus Henderson <fjh@cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh@128.250.37.3         |     -- the last words of T. S. Garp.