This is the mail archive of the gcc-help@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]

gfortran question regarding dummy procedures


Hi,

in the following Fortran code

PROGRAM MAIN
    EXTERNAL :: FOO
    INTERFACE
        SUBROUTINE S1(P1)
            INTERFACE
                FUNCTION P1(X)
                    INTEGER :: P1
                    INTEGER :: X1
                END FUNCTION P1
            END INTERFACE
        END SUBROUTINE S1

        SUBROUTINE S2(P2)
            INTERFACE
                FUNCTION P2(X)
                   REAL :: P2
                   REAL :: X
                END FUNCTION P2
            END INTERFACE
        END SUBROUTINE S2
    END INTERFACE

    CALL S1(FOO)  ! <-- why is this allowed?
    CALL S2(FOO)
END PROGRAM MAIN

why is gfortran (tested with 4.9.1) allowing the call to S1? FOO has a
REAL implicit type so it looks to me that it cannot match the
characteristics of P1.

Am I wrong or this is a gfortran bug?

Kind regards,

-- 
Roger Ferrer IbÃÃez


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