Test case:
------------------------------
module test
implicit none
interface
   subroutine hello(n)
     integer :: n
   end subroutine hello
end interface
end module test

subroutine hello(n)
  integer, intent(in) :: n
  integer :: i
  do i = 1,n; print *, 'hello'; end do
end subroutine hello
------------------------------

In the interface, "n" is implicitly "intent(inout)".
gfortran -Wall does not warn, NAG f95 does:
------------
Error: test3.f90: Inconsistent INTERFACE block for procedure HELLO from TEST
       Argument N (no. 1) has a different INTENT
[f95 error termination]
------------


-- 
           Summary: gfortran should warn if a interface does not match
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tobias dot burnus at physik dot fu-berlin dot de


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27318

  • [Bug fortran/27318] New:... tobias dot burnus at physik dot fu-berlin dot de

Reply via email to