F2003+ standard question regarding passing a scalar character to an array
- From: Tobias Burnus <burnus@xxxxxxxx>
- Date: Sun, 13 Feb 2011 11:48:28 +0100
I have problems with the following quote from the standard; I can read it in two ways: Either being a character is enough or such that a non-array-element scalar character is differently treated than one which is an array element. (The wording in F2003 is the same except for "noncoindexed" and "polymorphic".)
F2008, "220.127.116.11 Ordinary dummy variables":
"If the actual argument is a noncoindexed scalar, the corresponding dummy argument shall be scalar unless the actual argument is default character, of type character with the C character kind (15.2.2), or is an element or substring of an element of an array that is not an assumed-shape, pointer, or polymorphic array."
Thus, is the following program valid or not? Would there be a difference if one had a substring ["x(1)(1:1)"] or not?
character, pointer :: x(:)
character :: a(*)
end subroutine f
I assume a character actual argument which is a scalar pointer (and not an array element) is always valid - substring or not, isn't it?
PS: My feeling is that it requires an interpretation request though maybe I simply cannot read. In any case, as the next J3 meeting is already tomorrow, one has plenty of time to decide whether one should write an IR for the next meeting ...
- Prev by Date: Re: F2003+ standard question regarding passing a scalar character to an array
- Next by Date: Re: F2003+ standard question regarding passing a scalar character to an array
- Previous by thread: instructor's solutions manual for Statics and Mechanics of Materials by Bedford, Fowler, Liechti
- Next by thread: Re: F2003+ standard question regarding passing a scalar character to an array