Path: utzoo!mnetor!uunet!husc6!linus!philabs!pwa-b!mmintl!franka From: franka@mmintl.UUCP (Frank Adams) Newsgroups: comp.lang.c Subject: Re: Order of evaluation of nested function arguments Message-ID: <2704@mmintl.UUCP> Date: 3 Feb 88 14:53:07 GMT References: <3995@hoptoad.uucp> Reply-To: franka@mmintl.UUCP (Frank Adams) Organization: Multimate International, E. Hartford, CT. Lines: 23 In article <3995@hoptoad.uucp> gnu@hoptoad.uucp (John Gilmore) writes: > return(A(--x,A(x,--y))); > >In the oct 86 draft standard, it says that (3.3) "the evaluation of the >operands of an operator that involves a sequence point shall not be >interleaved with other evaluations". The function call operator >clearly involves a sequence point (3.3.2.2) "The order of evaluation of >the function designator, the arguments, and subexpressions within the >arguments is unspecified, but there is a sequence point before the >actual call". I interpret this to mean that, from the point where the code starts evaluating A(x,--y), until the actual call, nothing else can be executed. But it does not mean that A(x,--y) must be evaluated before the --x is. On such an interpretation, there would be no legal evaluation order at all for, e.g., A(A(--x,y),A(x,--y)). The call A(x,--y) is not being "interleaved" with the evaluation of the outer A and --x, because it is *part of* that evaluation. -- Frank Adams ihnp4!philabs!pwa-b!mmintl!franka Ashton-Tate 52 Oakland Ave North E. Hartford, CT 06108