This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/49509] cannot promote types for arguments passed by value
- From: "kargl at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 23 Jun 2011 02:10:51 +0000
- Subject: [Bug fortran/49509] cannot promote types for arguments passed by value
- Auto-submitted: auto-generated
- References: <bug-49509-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49509
kargl at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kargl at gcc dot gnu.org
--- Comment #1 from kargl at gcc dot gnu.org 2011-06-23 02:10:32 UTC ---
I believe your code is simply invalid on some targets.
You need to change
integer, parameter :: n = 3
to
integer(c_size_t), parameter :: n = 3
The matching of type, kind, and rank of actual
and dummy argument is a requirement of the Fortran
standard. This requirement is placed on the
programmer. What you want is explicitly prohibited
by the standard.
12.4.1.2 Actual arguments associated with dummy data objects
If a dummy argument is neither allocatable nor a pointer,
it shall be type compatible (5.1.1.2) with the associated
actual argument.
The type parameter values of the actual argument shall agree
with the corresponding ones of the dummy argument that are
not assumed or deferred, except for the case of the character
length parameter of an actual argument of type default character
associated with a dummy argument that is not assumed shape.
This should probably be closed as WONTFIX, but I'll let
other gfortran maintainers weigh in on the subject.