This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Fortran-Experiments]: patch
Hello Chris, hi all,
Christopher D. Rickett wrote:
> i've attached another patch for the fortran-experiments branch. it
> contains quite a bit of whitespace fixes and new test cases. it also has
> improved error messages for a few things and new error checking on binding
> labels. it also fixes some minor bugs, such as c_size_t and the required
> parens for subroutines marked with bind(c). bootstrapped and regtested on
> x86 with no new failures.
>
I applied it, build it (but did not bootstrap), tested it a bit, skimmed
the patch itself and regtested it on x86-64/openSUSE 10.2 with no
failures (but the old c_int_fast*_t in c_kind_params.f90).
Thanks for all those fixes. Steve, is this patch ok for the
fortran-experiments branch? If yes, I'd like to check it in.
Tobias
PS: Just to keep track myself:
- nested interfaces do not work yet,
http://gcc.gnu.org/ml/fortran/2007-02/msg00535.html
- gfortran rejects bind(c,name=""),
http://gcc.gnu.org/ml/fortran/2007-02/msg00505.html (b)
- gfortran allows functions to return an array,
http://gcc.gnu.org/ml/fortran/2007-02/msg00505.html (c)
- Same error is printed twice,
http://gcc.gnu.org/ml/fortran/2007-02/msg00496.html
- bind_c symbol collision:
----------- 1.f90--------
module x
use iso_c_binding
implicit none
integer(c_int), bind(c,name="c_one") :: one
end module x
---------------------------
----------- 2.f90--------
module y
use iso_c_binding
implicit none
integer(c_int), bind(c,name="c_one") :: one
end module y
program main
use x
use y
end program main
---------------------------
Does compile with gfortran, but NAG f95 outputs:
Error: 2.f90: Duplicate binding label 'c_one' for variable ONE of
module Y and variable ONE of module X
On the other hand, neither g95, sunf95 nor ifort 10 give a compile-time
error/warning.