This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH (head): -Wunused-static-variable
- From: Neil Booth <neil at daikokuya dot co dot uk>
- To: Kean Johnston <jkj at sco dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 2 May 2003 06:51:00 +0100
- Subject: Re: PATCH (head): -Wunused-static-variable
- References: <006f01c31052$ca96d0b0$03419384@shrike>
Kean Johnston wrote:-
> In reference to the message thread starting at
> http://gcc.gnu.org/ml/gcc/2003-04/msg01494.html
>
> how about the following patch. This is against the head, but I can
> easily redo this on the 3.3 branch if that is desired and someone
> can take care of the merging back to the head.
>
> 2003-05-01 Kean Johnston <jkj@sco.com>
>
> * c-opts.c (COMMAND_LINE_OPTIONS): Add -Wunused-static-variable
> for finer grained warning control.
> * doc/invoke.texi: Document it.
> * flags.h: Declare warn_unused_static_variable.
> * toplev.c (W_options): Add it.
> (check_global_declarations): Use it.
I don't think that c-opts.c should be setting flags that are in flags.h.
You need to decide if this is a C family front end switch or not and
adjust your patch appropriately.
IMO it should be implied by -Wall and require Wno-unused-static-variable
for those who don't want to fix their code. I don't see any good reason
for turning it off for anything other than char[] arrays, do you?
Neil.