[PATCH, Fortran] ABSTRACT INTERFACE

Janus Weil jaydub66@googlemail.com
Wed Aug 22 09:07:00 GMT 2007


Hi all,
I think I found a bug in the implementation of abstract interfaces.
Consider the following code:

program p
  abstract interface
    subroutine s()
    end subroutine
  end interface
contains
  subroutine x() bind(c,name="xyz")
  end subroutine
end program

This fails with:

subroutine x() bind(c,name="xyz")
                                  1
Error: NAME not allowed on BIND(C) for ABSTRACT INTERFACE at (1)

which clearly shouldn't happen, since the subroutine is not inside the
interface, but below it. Therefore I propose the attached patch, which
should fix this, and which also makes a small modification to
match_attr_spec to pass on any errors it gets from gfc_match_bind_c.
Cheers,
Janus


2007-08-22  Janus Weil  <jaydub66@gmail.com>

       * decl.c (match_attr_spec): Pass on errors from gfc_match_bind_c.
       (gfc_match_bind_c): Bugfix in check for NAME= with abstract interfaces.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: absint_bugfix.diff
Type: text/x-patch
Size: 974 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070822/5167ecf3/attachment.bin>


More information about the Gcc-patches mailing list