This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/18111] spurious warnings with -W -Wunused
- From: "martin at mpa-garching dot mpg dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Oct 2004 11:23:10 -0000
- Subject: [Bug fortran/18111] spurious warnings with -W -Wunused
- References: <20041022140406.18111.martin@mpa-garching.mpg.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From martin at mpa-garching dot mpg dot de 2004-10-26 11:23 -------
Here is a more comprehensive example:
module foo
implicit none
contains
subroutine bar(arg1, arg2, arg3, arg4)
character(len=80), intent(in) :: arg1
character(len=80), dimension(:), intent(in) :: arg2
integer, dimension(:), intent(in) :: arg3
integer, intent(in) :: arg4
print *, arg1, arg2, arg3, arg4
end subroutine bar
end module foo
~/tmp>gfortran -W -Wunused -c -O2 gfbug.f90
gfbug.f90:6: warning: unused parameter 'arg2'
gfbug.f90:6: warning: unused parameter 'arg3'
gfbug.f90:6: warning: unused parameter '_arg1'
gfbug.f90:6: warning: unused parameter '_arg2'
Note that there is no warning for arg4.
Note also that some of the warnings are only triggered with -O2.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18111