This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: A TOT bug in handling volatile vars?


On Friday, September 6, 2002, at 05:55 PM, Daniel Jacobowitz wrote:

You're off in the weeds somewhere :) Volatile is a qualifier on char,
not a qualifier on *. There's nothing special about v1 at all, only
about what it points to.

If I use:
volatile char *volatile v1 = 0;

it behaves as you expect. Heck, even turn on warnings:
tst.c:6: warning: variable `volatile char * v1' might be clobbered by `longjmp' or `vfork'
Oops, he's right.
  char *volatile v1
is good enough.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]