volatile [was: GCC warnings for unused global variables]

Fergus Henderson fjh@cs.mu.OZ.AU
Sat May 3 19:00:00 GMT 2003


On 03-May-2003, Michael Eager <eager@eagercon.com> wrote:
> An unreferenced volatile variable has no reads or writes which need to be
> represented.

I don't agree.  In C++, if the variable is static, it is first
zero-initialized, which is a write that needs to be represented,
and then if there is an initializer for it, it is initialized with
that value, which is another write that needs to be represented.

-- 
Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.



More information about the Gcc mailing list