This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/49509] cannot promote types for arguments passed by value


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]