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: Dale Johannesen <dalej at apple dot com>
- To: Daniel Jacobowitz <drow at mvista dot com>
- Cc: Dale Johannesen <dalej at apple dot com>, Ziemowit Laski <zlaski at apple dot com>, gcc at gcc dot gnu dot org
- Date: Fri, 6 Sep 2002 18:02:41 -0700
- Subject: 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.