Currently, there the interface of procedure calls is only checked if they are
use or host associated. It would be useful as error check, if optionally for
all procedures which are neither part of a module nor of the program, a .MOD
file could be created which contains their interface.

Example (put in one or two files, compile together or separately):
-----------------------
program main
  real(8) :: number
  number = run_u()
end program main

function run_u()
 implicit none
 real(4) :: run_u
 run_u = 42.0
end function run_u
-----------------------

The Intel compiler supports such an option:
   -gen-interface -warn interface
this creates:
  run_u_mod.mod
and 
  run_u_mod.f90
------------------------------------
        !COMPILER-GENERATED INTERFACE MODULE: Wed Jan 31 20:46:20 2007
        MODULE RUN_U_mod
          INTERFACE
            FUNCTION RUN_U RESULT(RUN_U_0)
              REAL(KIND=4) :: RUN_U_0
            END FUNCTION RUN_U
          END INTERFACE
        END MODULE RUN_U_mod
------------------------------------
which are then used. (Actually, ifort remains silent about the problem above.
It probably converts the real(4) into a real(8), but does not warn!)

Expected:
- gfortran has a similar option, which creates a .MOD file
- Maybe gfortran should also have another option to create a .f90 file
(Don't unify these options; as the .f90 files clutter only the directory.)


-- 
           Summary: Optionally, generate .mod files with the interface for
                    files containing only procedures
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


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

Reply via email to