[Fortran-Experiments] Merge to r120360
Christopher D. Rickett
crickett@lanl.gov
Wed Feb 21 22:29:00 GMT 2007
>> Once it's committed, i should be able to update and see what
>> whitespace problems there are.
> Go ahead. You can also look at the following problems:
>
> --------------------------
> module test
> use iso_c_binding
> type, bind(c) :: foo
> integer :: p
> end type
> type(foo), bind(c) :: cp
> end module test
> --------------------------
>
> Compiling shows the warning twice:
> ------------------------
> foo.f90:4.18:
>
> integer :: p
> 1
> Warnung: Component 'p' in derived type 'foo' at (1) may not be C
> interoperable, even though derived type 'foo' is BIND(C)
> foo.f90:4.18:
>
> integer :: p
> 1
> Warnung: Component 'p' in derived type 'foo' at (1) may not be C
> interoperable, even though derived type 'foo' is BIND(C)
> ------------------------
i'll work on this.
>
>
> gfortran compiles the following without any error/warning:
> -----------------------
> subroutine var bind(c)
> end subroutine var
> -----------------------
> I think this is invalid and one needs to add a "()", i.e. "subroutine
> var () bind(c)". (cf. R1232 in "12.5.2.2 Subroutine subprogram").
i didn't think that this was an error. the syntax rule for
subroutine-stmt and constraints listed in the annex D didn't specify that
the parens are required if you have bind(c) (at least not that i see). do
you know of a location where the standard makes the requirement?
>
> Maybe one could improve the error message for:
> subroutine var () bind(c,nAme=" bar 2")
> Currently, gfortran complains: "Syntax error in BIND(C) statement at (1)"
> NAG f95 is more explicit: "Embedded blank in C binding name"
i can try and improve that. this should be easy enough to catch.
> PS: I checked the items at the wiki and updated the todo list there (now
> essentially empty).
thanks for updating it.
Chris
More information about the Fortran
mailing list