-Wunused-parameter

Daniel Franke franke.daniel@gmail.com
Wed Aug 1 12:25:00 GMT 2007


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.



More information about the Gcc-patches mailing list