This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch, fortran] PR38407 - add -W[no-]unused-dummy-argument
- From: Daniel Franke <franke dot daniel at gmail dot com>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Thu, 20 May 2010 19:45:25 +0200
- Subject: Re: [patch, fortran] PR38407 - add -W[no-]unused-dummy-argument
- References: <201005201824.45605.franke.daniel@gmail.com> <4BF5716C.2070201@net-b.de>
On Thursday 20 May 2010 19:29:16 Tobias Burnus wrote:
> Currently, there will always be a warning if one does not set an
> INTENT(OUT) dummy argument (and be it by default initialization). About
> other dummy arguments, one only warns with -Wunused-variable.
This is not correct -- warn unset intent(out) is already linked to warn-used:
- else if (warn_unused_variable
- && sym->attr.dummy
- && sym->attr.intent == INTENT_OUT)
Using the respective testcase:
$> gfortran-4.5 -c -Wall warn_intent_out_not_set.f90
warn_intent_out_not_set.f90:25.19:
SUBROUTINE sub3(x) ! { dg-warning "not set" }
1
Warning: Dummy argument 'x' at (1) was declared INTENT(OUT) but was not set
$> gfortran-4.5 -c -Wall -Wno-unused warn_intent_out_not_set.f90
[no warning]
$> gfortran-4.5 -v
gcc version 4.5.1 20100520 (prerelease) (GCC)