(j3.2006) Interoperable dummy arguments
Wed May 24 20:20:28 EDT 2017
No you are not right, because C1555 makes no mention whatsoever of length
type parameters. A CHARACTER(*) variable is of interoperable type, but not
of interoperable type parameters.
C1554 provides an overall constraint with a list of things that a dummy
variable of a BIND(C) procedure needs to be. These are combined with "or",
which loses the type requirements for e.g. assumed-shape, allocatable and
pointer arguments. The purpose of C1555 is to maintain the type
requirements for e.g. assumed-shape etc.
I agree that it is a bit confusing. It might be worth us spending some time
trying to wordsmith those two constraints so that the structure requirements
are not mixed up with the type requirements. But we would need to be
careful not to break it...
Actually, looking at C1555 I think it is already slightly "broken", in that
I think it should be requiring interoperable kind type parameters. That is,
it clearly disallows a derived-type that is not a BIND(C) type, but it seems
to allow a REAL(k) type where k selects a representation method that does
not correspond to any C type. (The semantics of that would be
contradictory, so it cannot actually be conforming, but the standard does
not seem to get it right. Unless there are words elsewhere to sort that
out.) If this analysis is correct, some attention really should be given to
..............Malcolm Cohen, NAG Oxford/Tokyo.
From: j3-bounces at mailman.j3-fortran.org
[mailto:j3-bounces at mailman.j3-fortran.org] On Behalf Of erik at forcheck.nl
Sent: Wednesday, May 24, 2017 5:40 PM
To: 'fortran standards email list for J3' <j3 at mailman.j3-fortran.org>
Subject: (j3.2006) Interoperable dummy arguments
For a procedure with a proc-language-binding-spec there are a number of
constraints for its dummy arguments.
I see a conflict in C1554 and C1555:
C1554 allows a dummy argument of type CHARACTER with assumed length.
C1555 disallows this because a variable of type CHARACTER is only
interoperable if it has a length of 1.
Am I right?
J3 mailing list
J3 at mailman.j3-fortran.org
This e-mail has been scanned for all viruses by Star.
More information about the J3