After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 636949 - Fortran: INTERFACEs in procedures and unnamed INTERFACEs
Fortran: INTERFACEs in procedures and unnamed INTERFACEs
Status: RESOLVED DUPLICATE of bug 637610
Product: doxygen
Classification: Other
Component: general
1.7.2-SVN
Other All
: Normal normal
: ---
Assigned To: Dimitri van Heesch
Dimitri van Heesch
Depends on:
Blocks:
 
 
Reported: 2010-12-10 11:18 UTC by Daniel Franke
Modified: 2010-12-19 21:29 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Daniel Franke 2010-12-10 11:18:03 UTC
Interfaces in functions/subroutines should not be extracted, e.g. in

  SUBROUTINE foo(n)
    USE ISO_C_BINDING

    INTEGER, INTENT(out)

    INTERFACE
      FUNCTION c_foo() BIND(C, NAME="foo")
      END FUNCTION
    END INTERFACE

    n = c_foo()
  END SUBROUTINE

the c_foo interface should not be extracted and listed as interface by default (EXTRACT_PRIVATE=NO). It is not globally accessible.

Also, an unnamed interface as

  MODULE iface
    INTERFACE
      SUBROUTINE xyz(a, b, c)
        INTEGER :: a, b, c
      END SUBROUTINE
  END MODULE

has the name XYZ. In fortranscanner.l, line 421 (r749), one finds the comment:

  "// interface without name, must be inside subprog"

which is incorrect. The above example is perfectly valid. The name may be used to facilitate overloading and provide a generic name to different prototypes/interfaces, e.g.

  MODULE iface
    INTERFACE xyz
      SUBROUTINE xyz_sngl(x)
        REAL(4) :: x
      END SUBROUTINE
      SUBROUTINE xyz_dbl(x)
        REAL(8) :: x
      END SUBROUTINE
  END MODULE

Here, XYZ is the generic name of the interface for XYZ_SNGL and XYZ_DBL.
Comment 1 Daniel Franke 2010-12-10 11:26:10 UTC
Ups, the first part of this PR is a dupe of #521859.
Comment 2 Daniel Franke 2010-12-10 20:45:16 UTC
Comment #0 refers to GENERIC interfaces. However, for ABSTRACT interfaces, this is different. E.g.

  ABSTRACT INTERFACE
    SUBROUTINE a
    END SUBROUTINE
    SUBROUTINE b(i)
      INTEGER :: i
    END SUBROUTINE
    REAL FUNCTION f(x)
      REAL :: x
    END FUNCTION  
  END INTERFACE

is valid and equivalent to

  ABSTRACT INTERFACE
    SUBROUTINE a
    END SUBROUTINE
  END INTERFACE

  ABSTRACT INTERFACE
    SUBROUTINE b(i)
      INTEGER :: i
    END SUBROUTINE
  END INTERFACE

  ABSTRACT INTERFACE
    REAL FUNCTION f(x)
      REAL :: x
    END FUNCTION  
  END INTERFACE

So, the first version needs to produce three INTERFACE entries, each with its own name.
Comment 3 Daniel Franke 2010-12-19 21:29:35 UTC

*** This bug has been marked as a duplicate of bug 637610 ***