Newsgroups: comp.lang.c Path: utzoo!utgpu!jarvis.csri.toronto.edu!dgp.toronto.edu!flaps From: flaps@dgp.toronto.edu (Alan J Rosenthal) Subject: Re: noalias comments to X3J11 Message-ID: <8804050119.AA18474@explorer.dgp.toronto.edu> Organization: University of Toronto References: <12578@brl-adm.ARPA> <1988Mar25.172355.348@utzoo.uucp> <588@imagine.PAWL.RPI.EDU> Date: Mon, 4 Apr 88 19:19:20 EDT beowulf!lunge!jesup@steinmetz.UUCP writes: >The fact that things that need volatile probably won't be portable >across all machines that have C compilers is a non-issue. Hardly. We're discussing a standard for portable C programs. Compilers are free to accept non-conforming programs.[1] Your Amiga C compiler, IF it does optimizations of the kind that make `volatile' useful, would provide a volatile keyword for use in system-level programming whether or not it was required by the ANSI standard.[2] However, it would be silly for the whole world of compiler writers to have to recognize the volatile keyword, and take it into account while doing optimizations, just because on the Amiga there are uses for it in certain inherently non-portable programs.[3] ajr -- [1] Note that if the compiler doesn't allow a variable called ``volatile'' and the standard doesn't make this a reserved word, the compiler is not conforming. However, command-line options can control this. So can a #pragma. [2] That's a big if. [3] This is more of a floodgate than most people realize. For example, I can easily see the use, on the Amiga, for a type qualifier that meant, for example, that in the expression "f(a,a)" the two a's must have been obtained with the same (atomic) load instruction so that their values are guaranteed identical. Otherwise you have to turn off context-switching, assign `a' to a temporary variable, and turn it on again. -- "Comment, Spock?" "Very bad poetry, Captain."