Xref: utzoo comp.lang.c:10129 comp.arch:4825 Path: utzoo!attcan!uunet!mcvax!unido!iaoobelix!woerz From: woerz@iaoobelix.UUCP (Dieter Woerz) Newsgroups: comp.lang.c,comp.arch Subject: Re: volatile (in comp.lang.c) Message-ID: <166@iaoobelix.UUCP> Date: 14 May 88 17:42:39 GMT References: <20345@pyramid.pyramid.com> <833@mcdsun.UUCP> <9916@tekecs.TEK.COM> <2642@geac.UUCP> <2082@winchester.mips.COM> <1011@ima.ISC.COM> Reply-To: woerz@iaoobelix.UUCP (Dieter Woerz) Organization: Fraunhofer Institut fuer Arbeitswirtschaft und Organisation Lines: 34 Posted: Sat May 14 18:42:39 1988 Sender: In article <1011@ima.ISC.COM> johnl@ima.UUCP (John R. Levine) writes: > ... >or another. But whether "volatile" belongs in the standard is entirely another >thing. The standard defines a language for writing portable programs, i.e. >any standard-conforming program should do the same thing on all ANSI C >processors. I have never seen any suggestion that a program containing >"volatile" would be portable except perhaps to other processors which happen >to have similar memory, I/O, and hardware architectures. > ... I don't see, what "volatile" has todo with the hardware architecture. In my understanding, "volatile" simply says that the compiler has to access the variable in the memory every time the variable is access- ed. There seems to be nothing dependent on the hardware, exept that you can't get access to I/O ports on architectures, which don't have memory mapped I/O. So "volatile" has nothing todo with portability, because every compiler can be made to access a variable in memory every time it is read or writtten. I agree, that if you depend on "volatile" for doing memory mapped I/O, that wouldn't be too portable on an architecture with port I/O. But that low level I/O-Software normally doesn't have to be portable. ------------------------------------------------------------------------------ Dieter Woerz Fraunhofer Institut fuer Arbeitswirtschaft und Organisation Abt. 453 Holzgartenstrasse 17 D-7000 Stuttgart 1 W-Germany BITNET: iaoobel.uucp!woerz@unido.bitnet UUCP: ...{uunet!unido, pyramid}!iaoobel!woerz