mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-10 21:41:14 +08:00
re PR fortran/38220 (C_LOC intrinsic non-pure and without explicit interface)
2009-01-06 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/38220 * interface.c (gfc_procedure_use): Don't warn about functions from ISO_C_BINDING. * symbol.c (generate_isocbinding_symbol): Mark c_loc and c_funloc as pure. 2009-01-06 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/38220 * gfortran.dg/c_loc_pure_1.f90: New test. From-SVN: r143140
This commit is contained in:
parent
c10bf728da
commit
a9c5fe7e72
@ -1,3 +1,11 @@
|
||||
2009-01-06 Thomas Koenig <tkoenig@gcc.gnu.org>
|
||||
|
||||
PR fortran/38220
|
||||
* interface.c (gfc_procedure_use): Don't warn about functions
|
||||
from ISO_C_BINDING.
|
||||
* symbol.c (generate_isocbinding_symbol): Mark c_loc and
|
||||
c_funloc as pure.
|
||||
|
||||
2009-01-05 Paul Thomas <pault@gcc.gnu.org>
|
||||
|
||||
PR fortran/38657
|
||||
|
@ -2411,9 +2411,12 @@ void
|
||||
gfc_procedure_use (gfc_symbol *sym, gfc_actual_arglist **ap, locus *where)
|
||||
{
|
||||
|
||||
/* Warn about calls with an implicit interface. */
|
||||
/* Warn about calls with an implicit interface. Special case
|
||||
for calling a ISO_C_BINDING becase c_loc and c_funloc
|
||||
are pseudo-unknown. */
|
||||
if (gfc_option.warn_implicit_interface
|
||||
&& sym->attr.if_source == IFSRC_UNKNOWN)
|
||||
&& sym->attr.if_source == IFSRC_UNKNOWN
|
||||
&& ! sym->attr.is_iso_c)
|
||||
gfc_warning ("Procedure '%s' called with an implicit interface at %L",
|
||||
sym->name, where);
|
||||
|
||||
|
@ -4169,6 +4169,7 @@ generate_isocbinding_symbol (const char *mod_name, iso_c_binding_symbol s,
|
||||
tmp_sym->result = tmp_sym;
|
||||
tmp_sym->attr.external = 1;
|
||||
tmp_sym->attr.use_assoc = 0;
|
||||
tmp_sym->attr.pure = 1;
|
||||
tmp_sym->attr.if_source = IFSRC_UNKNOWN;
|
||||
tmp_sym->attr.proc = PROC_UNKNOWN;
|
||||
}
|
||||
|
@ -1,3 +1,8 @@
|
||||
2009-01-06 Thomas Koenig <tkoenig@gcc.gnu.org>
|
||||
|
||||
PR fortran/38220
|
||||
* gfortran.dg/c_loc_pure_1.f90: New test.
|
||||
|
||||
2009-01-06 Mikael Morin <mikael.morin@tele2.fr>
|
||||
|
||||
PR fortran/38669
|
||||
|
11
gcc/testsuite/gfortran.dg/c_loc_pure_1.f90
Normal file
11
gcc/testsuite/gfortran.dg/c_loc_pure_1.f90
Normal file
@ -0,0 +1,11 @@
|
||||
! { dg-do compile }
|
||||
! { dg-options "-Wimplicit-interface" }
|
||||
! PR 38220 - c_loc is pure and has an explicit interface
|
||||
USE ISO_C_BINDING, ONLY: C_PTR, C_LOC
|
||||
CONTAINS
|
||||
PURE SUBROUTINE F(x)
|
||||
INTEGER, INTENT(in), TARGET :: x
|
||||
TYPE(C_PTR) :: px
|
||||
px = C_LOC(x)
|
||||
END SUBROUTINE
|
||||
END
|
Loading…
x
Reference in New Issue
Block a user