This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/40354] bug with procedure pointers and C interoperability
- From: "kargl at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Jun 2009 15:12:28 -0000
- Subject: [Bug fortran/40354] bug with procedure pointers and C interoperability
- References: <bug-40354-17801@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from kargl at gcc dot gnu dot org 2009-06-05 15:12 -------
Looks like a bug in ifort and g95.
15.1.2.4 C FUNLOC (X)
Description. Returns the C address of the argument.
Class. Inquiry function.
Argument. X shall either be a procedure that is interoperable,
or a procedure pointer associated with an interoperable
procedure.
sub1 isn't a procedure pointer, so everything after the 'or' is
irrelevant. Now, for the 'either' portion of the above.
15.2.6 Interoperability of procedures and procedure interfaces
A Fortran procedure is interoperable if it has the BIND attribute,
that is, if its interface is specified with a proc-language-binding-spec.
R1225 proc-language-binding-spec is language-binding-spec
R509 language-binding-spec is
BIND (C [, NAME = scalar-char-initialization-expr ])
What do the experts on comp.lang.fortran think of your code?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40354