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, Sep 6, 2002, at 17:55 US/Pacific, 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'
D'oh.  Thanks. :-)

--Zem
--------------------------------------------------------------
Ziemowit Laski                 1 Infinite Loop, MS 301-2K
Mac OS X Compiler Group        Cupertino, CA USA  95014-2083
Apple Computer, Inc.           +1.408.974.6229  Fax .5477


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