This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/47023] C_Sizeof: Rejects valid code
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 17 Oct 2011 19:22:15 +0000
- Subject: [Bug fortran/47023] C_Sizeof: Rejects valid code
- Auto-submitted: auto-generated
- References: <bug-47023-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47023
--- Comment #16 from janus at gcc dot gnu.org 2011-10-17 19:22:15 UTC ---
(In reply to comment #7)
> By the way, I think one should reject proc-pointers for both SIZEOF and
> C_SIZEOF. For C_SIZEOF because they are not interoperable (only type(c_funptr)
> is) and for SIZEOF as the pointee size and not the pointer size is returned,
> which does not make sense for functions. (gfortran currently returns 1 byte.)
For C_SIZEOF, proc-pointers are rejected since 4.6. Example code:
use iso_c_binding
procedure(), pointer :: pp
print *, c_sizeof(pp)
end
Error: 'x' argument of 'c_sizeof' intrinsic at (1) must be an interoperable
data entity
About SIZEOF I don't worry right now. Since it is an extension, we can
basically do whatever we like.