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: Tue, 18 Oct 2011 12:03:58 +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 #19 from janus at gcc dot gnu.org 2011-10-18 12:03:58 UTC ---
(In reply to comment #18)
> > * reject proc-pointers for SIZEOF (comment #7)
Example:
use iso_c_binding
procedure(real), pointer :: pp
procedure(real) :: proc
pp => sin
print *,sizeof(proc) ! (1)
print *,sizeof(pp) ! (2)
print *,sizeof(pp(0.)) ! (3)
end
Currently this gives the output:
1
1
4
The last one is correct, giving the size of the return value of the called
function. The first one should eventually be rejected. For the second one, it's
not completely clear where the '1' comes from, but it's certainly wrong (in any
possible interpretation).