volatile

Richard Tobin richard at aiva.ed.ac.uk
Thu Mar 31 06:04:58 AEST 1988


In article <1988Mar29.004454.2867 at utzoo.uucp> henry at utzoo.uucp (Henry Spencer) writes:
>situations.  The point is that these are a sufficiently small subset of C
>applications that the need should addressed with #pragma, rather than by
>cluttering up the type system with it.  The principal problem with #pragma
>is that it is not portable, since its semantics are not standardized, but
>the sort of code we're talking about isn't portable anyway.

It's true that any particular instance of the use of such constructs isn't
portable, but the concept behind it is.  That is, of course code that
manipulates a memory-mapped device register (or similar) won't run on
different machines, but that doesn't mean that it's unreasonable to have
a standard way of expressing that a location is such a register.

Furthermore, #pragma isn't even portable between different compilers on
the same machine, whereas something like "volatile" is.  And it's 
increasingly common to have more than one C compiler available.

-- Richard
-- 
Richard Tobin,                         JANET: R.Tobin at uk.ac.ed             
AI Applications Institute,             ARPA:  R.Tobin%uk.ac.ed at nss.cs.ucl.ac.uk
Edinburgh University.                  UUCP:  ...!ukc!ed.ac.uk!R.Tobin



More information about the Comp.lang.c mailing list