This is the mail archive of the
mailing list for the GCC project.
Re: Don't warn about unused volatile static variables
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- To: Geoffrey Keating <gkeating at apple dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 4 May 2003 00:07:48 +0100 (BST)
- Subject: Re: Don't warn about unused volatile static variables
- References: <200305032157.h43LvCRm004198@keatge.apple.com>
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/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