This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch, fortran] PR38407 - add -W[no-]unused-dummy-argument


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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]