This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Fortran-Experiments] Merge to r120360


Hi,

Christopher D. Rickett wrote:
>> Yes.  Of course, you may want to give it a build/regression test.
Applied the patch, bootstrapped, did make check-gfortran and committed
the two patches.

> 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)
------------------------


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").

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"

Tobias

PS: I checked the items at the wiki and updated the todo list there (now
essentially empty).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]