This is the mail archive of the gcc-patches@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: Don't warn about unused volatile static variables


On Sat, 3 May 2003, Geoffrey Keating wrote:

> When a variable is declared volatile, it might be used in some
> non-obvious way.  For instance, you might have some kind of garbage
> collection system in your linker but want to make sure that some
> variable isn't collected, and write:
> 
> extern int x;
> static const volatile void *x_ref = &x;

As x_ref isn't declared volatile (rather pointer to volatile) here, I hope 
this case does still warn....

> Bootstrap & test in progress on powerpc-darwin; I'll wait for a bit to
> see if there are any strenuous objections.

I don't think this patch will generate any merge conflicts with the one at
<http://gcc.gnu.org/ml/gcc-patches/2003-05/msg00321.html> and
<http://gcc.gnu.org/ml/gcc-patches/2003-05/msg00333.html>, but it may make
sense to get that one in first (assuming it works) (mainline and 3.3;  
further mainline refinements can go on top of it).

-- 
Joseph S. Myers
jsm28@cam.ac.uk


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