This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: -Wunused-parameter
- From: Daniel Franke <franke dot daniel at gmail dot com>
- To: fortran at gcc dot gnu dot org
- Cc: Tobias Schlüter <Tobias dot Schlueter at physik dot uni-muenchen dot de>, gcc-patches at gcc dot gnu dot org, Angelo dot Graziosi at roma1 dot infn dot it
- Date: Wed, 1 Aug 2007 14:25:20 +0200
- Subject: Re: -Wunused-parameter
- References: <200708011326.22662.franke.daniel@gmail.com> <46B07A91.1040807@physik.uni-muenchen.de>
On Wednesday 01 August 2007 14:20:33 Tobias Schlüter wrote:
> Daniel Franke wrote:
> > Index: fortran/trans-decl.c
> > ===================================================================
> > --- fortran/trans-decl.c (revision 127062)
> > +++ fortran/trans-decl.c (working copy)
> > @@ -3031,7 +3031,7 @@ generate_local_decl (gfc_symbol * sym)
> > }
> > else if (sym->attr.flavor == FL_PARAMETER)
> > {
> > - if (warn_unused_variable
> > + if (warn_unused_parameter
> > && !sym->attr.referenced
> > && !sym->attr.use_assoc)
> > gfc_warning ("unused parameter '%s' declared at %L", sym->name,
>
> ^
> While you're touching this area, can you change this to uppercase, as is
> the convention elsewhere?
This is not so common as to make a rule of it. The same function emits other
warnings that start with lower case also.
> As far as the patch itself goes, does -Wunused-parameter affect warnings
> for unused dummy arguments in Fortran code? In that case, your patch
> may not be the right thing, otherwise I'm all in favor of applying it.
Warnings for unused dummy arguments are emitted in the same function, just
above the changes. They are tied to -Wunused (variable). To be fully correct,
we probably need to introduce -Wunused-dummy-argument.