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: net.lang.c Subject: Re: Volatile type in ANSI C Message-ID: <5549@utzoo.UUCP> Date: Sat, 27-Apr-85 19:29:53 EST Article-I.D.: utzoo.5549 Posted: Sat Apr 27 19:29:53 1985 Date-Received: Sat, 27-Apr-85 19:29:53 EST References: <543@lll-crg.ARPA> Organization: U of Toronto Zoology Lines: 16 > Looking at the description for the volatile type in the draft of the > ANSI C standard there seems to be some incompleteness. > The volatile type could have uses in multiprocessing where several > processors share some data areas. One could have volatile pointers to > non volatile data areas (rarely) and more frequently nonvolatile pointers > to volatile data areas that are shared with other processors. > Does the ANSI C standard address these issues? Yes. It provides both. "volatile int *foo;" declares a nonvolatile pointer to volatile; "int * volatile foo;" declares a volatile pointer to nonvolatile. (Excuse me a moment while I barf over the syntax.) If you're really a masochist, "volatile int * volatile foo;" is a volatile pointer to a volatile area. -- Henry Spencer @ U of Toronto Zoology {allegra,ihnp4,linus,decvax}!utzoo!henry