Path: utzoo!attcan!uunet!husc6!necntc!ima!haddock!karl
From: karl@haddock.ISC.COM (Karl Heuer)
Newsgroups: comp.lang.c
Subject: Re: volatile: a summary
Message-ID: <4498@haddock.ISC.COM>
Date: 10 Jun 88 16:59:50 GMT
References: <11837@mimsy.UUCP> <796@l.cc.purdue.edu>
Reply-To: karl@haddock.ima.isc.com (Karl Heuer)
Organization: Interactive Systems, Boston
Lines: 10

In article <796@l.cc.purdue.edu> cik@l.cc.purdue.edu (Herman Rubin) writes:
>[In the code fragment "x = random();"] it is essential that the computation
>of random() be done at _each_ call.  Volatile beats all of the kludges I
>have seen to accomplish this.

I don't see what this has to do with the |volatile| in dpANS.  C makes no
provisions for pure functions, so random() (or getchar()) must always be
invoked no matter what (subject, as always, to the as-if rule).

Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint