This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: A TOT bug in handling volatile vars?
- From: Ziemowit Laski <zlaski at apple dot com>
- To: Daniel Jacobowitz <drow at mvista dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 6 Sep 2002 18:00:10 -0700
- Subject: 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