------- 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

Reply via email to