Commit 2be51762 by Tobias Burnus Committed by Tobias Burnus

re PR fortran/40110 (Bind(C): gfortran rejects the questionable but formally…

re PR fortran/40110 (Bind(C): gfortran rejects the questionable but formally correct INTEGER(C_CHAR))

2009-05-12  Tobias Burnus  <burnus@net-b.de>

        PR fortran/40110
        * decl.c (gfc_match_kind_spec): Turn C kind error into a
        * warning.

2009-05-12  Tobias Burnus  <burnus@net-b.de>

        PR fortran/40110
        * gfortran.dg/bind_c_usage_18.f90: Change dg-error into
        dg-warning.
        * gfortran.dg/c_kind_tests_2.f03: Ditto.
        * gfortran.dg/interop_params.f03: Ditto.

From-SVN: r147452
parent cdeed45a
2009-05-12 Tobias Burnus <burnus@net-b.de>
PR fortran/40110
* decl.c (gfc_match_kind_spec): Turn C kind error into a warning.
2009-05-11 Steve Ellcey <sje@cup.hp.com>
* resolve.c (check_host_association): Initialize tail.
......
......@@ -2000,9 +2000,9 @@ kind_expr:
if (ts->f90_type != BT_UNKNOWN && ts->f90_type != ts->type
&& !((ts->f90_type == BT_REAL && ts->type == BT_COMPLEX)
|| (ts->f90_type == BT_COMPLEX && ts->type == BT_REAL)))
gfc_error_now ("C kind type parameter is for type %s but type at %L "
"is %s", gfc_basic_typename (ts->f90_type), &where,
gfc_basic_typename (ts->type));
gfc_warning_now ("C kind type parameter is for type %s but type at %L "
"is %s", gfc_basic_typename (ts->f90_type), &where,
gfc_basic_typename (ts->type));
gfc_gobble_whitespace ();
if ((c = gfc_next_ascii_char ()) != ')'
......
2009-05-12 Tobias Burnus <burnus@net-b.de>
PR fortran/40110
* gfortran.dg/bind_c_usage_18.f90: Change dg-error into dg-warning.
* gfortran.dg/c_kind_tests_2.f03: Ditto.
* gfortran.dg/interop_params.f03: Ditto.
2009-05-12 Jan Hubicka <jh@suse.cz>
* gcc.dg/tree-ssa/loop-36.c: Reduce amount of iterations to 2 so unrolling
......
......@@ -7,7 +7,7 @@ subroutine foo(x,y,z,a) bind(c) ! { dg-warning "but may not be C interoperable"
use iso_c_binding
implicit none
integer(4) :: x
integer(c_float) :: y ! { dg-error "C kind type parameter is for type REAL" }
integer(c_float) :: y ! { dg-warning "C kind type parameter is for type REAL" }
complex(c_float) :: z ! OK, c_float == c_float_complex
real(c_float_complex) :: a ! OK, c_float == c_float_complex
end subroutine foo
......@@ -16,8 +16,8 @@ use iso_c_binding
implicit none
integer, parameter :: it = c_int
integer, parameter :: dt = c_double
complex(c_int), target :: z1 ! { dg-error "C kind type parameter is for type INTEGER" }
complex(it), target :: z2 ! { dg-error "C kind type parameter is for type INTEGER" }
complex(c_int), target :: z1 ! { dg-warning "C kind type parameter is for type INTEGER" }
complex(it), target :: z2 ! { dg-warning "C kind type parameter is for type INTEGER" }
complex(c_double), target :: z3 ! OK
complex(dt), target :: z4 ! OK
type(c_ptr) :: ptr
......
......@@ -4,11 +4,11 @@ module c_kind_tests_2
integer, parameter :: myF = c_float
real(myF), bind(c) :: myCFloat
integer(myF), bind(c) :: myCInt ! { dg-error "is for type REAL" }
integer(c_double), bind(c) :: myCInt2 ! { dg-error "is for type REAL" }
integer(myF), bind(c) :: myCInt ! { dg-warning "is for type REAL" }
integer(c_double), bind(c) :: myCInt2 ! { dg-warning "is for type REAL" }
integer, parameter :: myI = c_int
real(myI) :: myReal ! { dg-error "is for type INTEGER" }
real(myI), bind(c) :: myCFloat2 ! { dg-error "is for type INTEGER" }
real(myI) :: myReal ! { dg-warning "is for type INTEGER" }
real(myI), bind(c) :: myCFloat2 ! { dg-warning "is for type INTEGER" }
real(4), bind(c) :: myFloat ! { dg-warning "may not be a C interoperable" }
end module c_kind_tests_2
......@@ -14,7 +14,7 @@ contains
end subroutine test_0
subroutine test_1(my_f90_real) bind(c)
real(c_int), value :: my_f90_real ! { dg-error "is for type INTEGER" }
real(c_int), value :: my_f90_real ! { dg-warning "is for type INTEGER" }
end subroutine test_1
subroutine test_2(my_type) bind(c) ! { dg-error "is not C interoperable" }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment