public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/40039]  New: Procedures as actual arguments: Check intent of arguments
@ 2009-05-06  8:51 janus at gcc dot gnu dot org
  2009-05-06 10:30 ` [Bug fortran/40039] " burnus at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-05-06  8:51 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1375 bytes --]

Consider the following module:


module m

contains

subroutine a(x,f)
  real :: x
  interface
    real function f(y)
      real,intent(in) :: y
    end function
  end interface
  print *,f(x)
end subroutine

real function func(z)
  real,intent(inout) :: z
  func = z**2
end function

subroutine caller
  call a(4.3,func)
end subroutine

end module 


ifort complains:
error #7061: The characteristics of dummy argument 1 of the associated actual
procedure differ from the characteristics of dummy argument 1 of the dummy
procedure. (12.2)   [FUNC]
  call a(4.3,func)

Although gfortran, g95 and sunf95 accept it, I think ifort is right to reject
it (but I haven't checked the standard yet). The same check should also be
applied to procedure pointer assignments.

Btw "gfortran -Wall -Wextra" produces this warning:
test.f90:5: warning: unused parameter ‘f’
This is bogus, because 'f' *is* used in the subroutine a.


-- 
           Summary: Procedures as actual arguments: Check intent of
                    arguments
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: janus at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 10+ messages in thread
[parent not found: <bug-40039-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2012-04-25 17:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-06  8:51 [Bug fortran/40039] New: Procedures as actual arguments: Check intent of arguments janus at gcc dot gnu dot org
2009-05-06 10:30 ` [Bug fortran/40039] " burnus at gcc dot gnu dot org
2009-05-07 21:44 ` janus at gcc dot gnu dot org
2009-05-13 17:16 ` janus at gcc dot gnu dot org
2009-05-18  9:19 ` janus at gcc dot gnu dot org
2009-05-18  9:28 ` janus at gcc dot gnu dot org
2009-06-16  9:06 ` janus at gcc dot gnu dot org
2009-06-16  9:17 ` janus at gcc dot gnu dot org
     [not found] <bug-40039-4@http.gcc.gnu.org/bugzilla/>
2012-04-25 15:24 ` janus at gcc dot gnu.org
2012-04-25 17:00 ` janus at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).