volatile registers (was: The world is not ready for 'volatile')

T. William Wells bill at twwells.uucp
Sat Jan 7 23:59:05 AEST 1989


In article <9316 at ihlpb.ATT.COM> nevin1 at ihlpb.UUCP (55528-Liber,N.J.) writes:
: [Side note:  I was skimming through the dpANS C, and the only place I
: could find restricting register to being non-aliased is in footnote
: #55, section 3.5.1.  Since footnotes aren't an official part of the
: Standard, could someone please email me an official reference to this?
: If it is not official, then I am asking why not?]

It doesn't have to say this. To alias something, one must have its
address.  Registers can't have their addresses taken. Therefore
register variables can't be aliased. QED.

: [Another side note:  is it even possible to have a strictly conforming
: C program whose behavior would change by declaring any of its
: variables volatile?

No. Volatile might change the way the compiler generates code.  And
that may change the way that the compiler handles implementation
defined parts of the language. However, by definition, a strictly
conforming C program can't behave differently because of something
implementation defined.  Thus, if a program were to change because of
the volatile keyword, it wouldn't have been a strictly conforming
program in the first place.

---
Bill
{ uunet!proxftl | novavax } !twwells!bill



More information about the Comp.std.c mailing list