Xref: utzoo comp.lang.c:10076 comp.arch:4779 Path: utzoo!attcan!uunet!husc6!bloom-beacon!mit-eddie!ll-xn!ames!pasteur!ucbvax!decwrl!hplabs!sdcrdcf!ism780c!haddock!ima!johnl From: johnl@ima.ISC.COM (John R. Levine) Newsgroups: comp.lang.c,comp.arch Subject: Re: volatile (in comp.lang.c) Message-ID: <1011@ima.ISC.COM> Date: 11 May 88 16:13:47 GMT References: <20345@pyramid.pyramid.com> <833@mcdsun.UUCP> <9916@tekecs.TEK.COM> <2642@geac.UUCP> <2082@winchester.mips.COM> <2674@geac.UUCP <1030@micomvax.UUCP> Reply-To: johnl@ima.UUCP (John R. Levine) Organization: Not much Lines: 28 In article <1030@micomvax.UUCP> ray@micomvax.UUCP (Ray Dunn) writes: >As I said in an earlier posting (on reflection not very succinctly), a >compiler for a particular [micro-processor] CPU can make *no* assumptions >about the architecture that the compiled code is running on, other than [the >architecture of the microprocessor itself]. > ... >So it's not reasonable to make these controls [e.g. "volatile"] a compiler >specific thing. > >They *have* to be part of the language. It seems to me that we have a confusion here between making constructs part of the language and making them part of the standard. Nobody has ever said that ANSI C compilers shouldn't have extensions -- they all will, of some sort 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. So, sure, go ahead and put it in your compiler where it will be useful for all sorts of stuff. But keep it out of the standard until you can define it in a way that will produce the same results on all C processors. -- John R. Levine, IECC, PO Box 349, Cambridge MA 02238-0349, +1 617 492 3869 { ihnp4 | decvax | cbosgd | harvard | yale }!ima!johnl, Levine@YALE.something Rome fell, Babylon fell, Scarsdale will have its turn. -G. B. Shaw