Bug 27318 - gfortran should warn if a interface does not match
Summary: gfortran should warn if a interface does not match
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.1.0
: P3 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: diagnostic
: 45086 45654 (view as bug list)
Depends on:
Blocks: 29670
  Show dependency treegraph
 
Reported: 2006-04-25 18:12 UTC by tobias.burnus
Modified: 2018-03-21 17:29 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-04-25 18:39:13


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tobias.burnus 2006-04-25 18:12:55 UTC
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]
------------
Comment 1 Andrew Pinski 2006-04-25 18:39:13 UTC
Confirmed.
Comment 2 Daniel Franke 2010-12-28 18:23:33 UTC
*** Bug 45654 has been marked as a duplicate of this bug. ***
Comment 3 Daniel Franke 2010-12-28 18:26:20 UTC
*** Bug 45086 has been marked as a duplicate of this bug. ***