Path: utzoo!attcan!uunet!mcvax!enea!kth!draken!liuida!mikpe
From: mikpe@mina.liu.se (Mikael Pettersson)
Newsgroups: comp.lang.c
Subject: side effects in argument lists
Message-ID: <1077@mina.liu.se>
Date: 28 Nov 88 07:39:56 GMT
Organization: CIS Dept, Univ of Linkoping, Sweden
Lines: 28


Consider the following program:
---snip---
#include 
int count = 0;
void bletch(int junk) {
	printf("count == %d\n", count); /* 0 or 1 ? */
}
main() {
	bletch(count++);
	exit(0);
}
---snip---
This program exemplifies the situation where the behaviour of the
callee depends on whether the caller has completed *all* of the
side effects from evaluating the arguments of the call or not.

Q: what sayeth the dpANS about this?
If count++ _is_defined_as_ (++count, count-1) then I guess things
are cool, but what if the definition is less strict?


/Mike
-- 
Mikael Pettersson           ! Internet:mpe@ida.liu.se
Dept of Comp & Info Science ! UUCP:    mpe@liuida.uucp  -or-
University of Linkoping     !          {mcvax,munnari,uunet}!enea!liuida!mpe
Sweden                      ! ARPA:    mpe%ida.liu.se@uunet.uu.net