This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC warnings for unused global variables
- From: Geoff Keating <geoffk at geoffk dot org>
- To: jkj at sco dot com
- Cc: rth at redhat dot com, gdr at integrable-solutions dot net, fjh at cs dot mu dot OZ dot AU, jbuck at synopsys dot com, espie at quatramaran dot ens dot fr, gcc at gcc dot gnu dot org
- Date: Sat, 3 May 2003 01:03:28 -0700
- Subject: Re: GCC warnings for unused global variables
- References: <00be01c3112c$3e26a8a0$03419384@shrike>
> X-Original-To: geoffk@foam.wonderslug.com
> From: "Kean Johnston" <jkj@sco.com>
> Cc: <gdr@integrable-solutions.net>, <fjh@cs.mu.OZ.AU>, <jbuck@synopsys.com>,
> <espie@quatramaran.ens.fr>, <gcc@gcc.gnu.org>
> Date: Fri, 2 May 2003 21:27:00 -0700
> Organization: The SCO Group
> X-Priority: 3 (Normal)
> X-MSMail-Priority: Normal
> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
> Importance: Normal
> X-OriginalArrivalTime: 03 May 2003 04:37:15.0533 (UTC) FILETIME=[AC1DA3D0:01C3112D]
> X-MIME-Autoconverted: from quoted-printable to 8bit by desire.geoffk.org id h434cdn13707
>
> > It's implementation-defined what is an 'access'.
> >
> > It looks like it's useful to define initialization as an 'access', for
> > exactly this case: rcsid, or in general magic code that looks at
> > object files. So, let's do that.
> Careful.
>
> If you mark initialization as access, and that makes the warnings go
> away, we'd lose some considerable value to the warning. Just because
> this rcsid is such a PITA, doesn't mean it shouldbe be warned about
> if that's what the user wants, but since its initialized, if that makes
> the warning go away that's bad. Same for any other variable that's
> initialzied but not used (in static scope of course).
This would only be for volatile initialized static variables, not the
general case.
--
- Geoffrey Keating <geoffk@geoffk.org>