This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/32804] ISO C Binding: C_LOC argument checking needs improvement
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Jul 2007 08:30:57 -0000
- Subject: [Bug fortran/32804] ISO C Binding: C_LOC argument checking needs improvement
- References: <bug-32804-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from burnus at gcc dot gnu dot org 2007-07-19 08:30 -------
For the accept-invalid part (c_loc of an assumed-shape array). The standard
says:
"X shall either
(1) have interoperable type and type parameters and be
(a) a variable that has the TARGET attribute and is interoperable,"
This variable has the TARGET attribute, but is not interoperable:
"An array Fortran variable is interoperable if its type and type parameters are
interoperable and it is of explicit shape or assumed size."
Thus this error by NAG f95 is ok; however, as it is accepted by ifort, g95 and
(currently) gfortran. As I completely fail to see any valid use of it and see
several cases where it seems to work but one uses in reality the wrong array
element, I favour to not allowing it even for -std=gnu. But if one finds a
valid use, I'm also fine with an error only for -std=f2003.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32804