🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.c
Article #9380

Evaluation of function arguments (w/ side-effects)

#9380
From: LINNDR%VUENGVAX.BITNET
Date: Mon, 22 Sep 1986 06:11
26 lines
1164 bytes
Does anyone know of a compiler for which the program below does NOT
produce the output shown?
----------------------------------
/* order - program to demonstrate order of function argument evaluation */
/*      David Linn - Vanderbilt University - 1986                       */
main()
{
        int i;

        i = 0;
        auxfun(i++,i++,i++);
        printf("%d\n",i);
}

auxfun(a,b,c)
{
        printf("%d,%d,%d\n",a,b,c);
}
----- PROGRAM OUTPUT ---------------
2,1,0
3
------------------------------------

David Linn
LINNDR%VUENGVAX.BITNET@WISCVM.WISC.EDU          ! Internet (I think)
...!psuvax1!vuengvax.bitnet!linndr              ! Usenet
Technical Details
Message-ID: <3966@brl-smoke.ARPA>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!brl-adm!brl-smoke!smoke!LINNDR%VUENGVAX.BITNET@wiscvm.ARPA

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!brl-adm!brl-smoke!smoke!LINNDR%VUENGVAX.BITNET@wiscvm.ARPA
From: LINNDR%VUENGVAX.BITNET@wiscvm.ARPA
Newsgroups: net.lang.c
Subject: Evaluation of function arguments (w/ side-effects)
Message-ID: <3966@brl-smoke.ARPA>
Date: Mon, 22-Sep-86 02:11:22 EDT
Article-I.D.: brl-smok.3966
Posted: Mon Sep 22 02:11:22 1986
Date-Received: Wed, 24-Sep-86 07:05:53 EDT
Sender: news@brl-smoke.ARPA
Lines: 26