This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/32655] New: gfortran rejects PURE subroutine


I have a PURE subroutine which requires a PURE functions as arguments. When I
attempt to compile the code, gfortran says:

$ gfortran -c test.f90 
 In file test.f90:6

  PURE SUBROUTINE Demo( dydx )
                           1
Error: Argument 'dydx' of pure subroutine 'demo' at (1) must have its INTENT
specified


when dydx is supposed to be a function given as an argument, and hence
specifying INTENT makes no sense.

The file test.f90 is as follows:

MODULE BugTest
  IMPLICIT NONE
  PRIVATE
  PUBLIC :: Demo
CONTAINS
  PURE SUBROUTINE Demo( dydx )

    INTERFACE
       PURE FUNCTION dydx(x,ys) RESULT( yprime )
         IMPLICIT NONE
         REAL, INTENT(IN) :: x
         REAL, INTENT(IN) :: ys(:)
         REAL :: yprime(SIZE(ys))
       END FUNCTION dydx
    END INTERFACE

  END SUBROUTINE Demo
END MODULE BugTest

This is on Fedora Core 5:

$ gfortran --version
GNU Fortran 95 (GCC) 4.1.1 20070105 (Red Hat 4.1.1-51)


-- 
           Summary: gfortran rejects PURE subroutine
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rge21 at pas dot rochester dot edu


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]