Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: comp.lang.c Subject: Re: Problem with either ANSI 'C' or Dr Dobbs Journal. Message-ID: <8383@utzoo.UUCP> Date: Thu, 6-Aug-87 14:21:12 EDT Article-I.D.: utzoo.8383 Posted: Thu Aug 6 14:21:12 1987 Date-Received: Thu, 6-Aug-87 14:21:12 EDT References: <449@sugar.UUCP> Organization: U of Toronto Zoology Lines: 20 > According to an article on ANSI 'C' in Dr Dobb's Journal, a prototype > with a fixed number of arguments means the routine may be called without > unwinding the stack on return... the assumption being that the called > routine popped its arguments with a "RET N" type instruction. Sorry, basically wrong. Unless ANSI has done something terrible since the draft I've got (1 Oct 1986, the public-comment draft), functions are required to behave properly, subject to certain restrictions on argument types, even if a function prototype is visible at definition but not at call, or vice-versa. This means, pretty much, that the presence or absence of a prototype can't make a difference in something as basic as who pops the stack. > It then adds that if no prototype is provided, the function may be > assumed to have a fixed number of arguments. This is simply wrong: no prototype means no assumptions. -- Support sustained spaceflight: fight | Henry Spencer @ U of Toronto Zoology the soi-disant "Planetary Society"! | {allegra,ihnp4,decvax,utai}!utzoo!henry