(j3.2006) (SC22WG5.5519) Assignment to ero-sized strings and arrays
Walt Brainerd
walt.brainerd
Tue Jun 16 17:13:01 EDT 2015
OK, I agree with Malcolm that just because there are false
statements in the standard, it doesn't mean implementors
will follow them.
But to make the standard consistent, the following should be added:
No value is assigned to the variable if it is of type integer, real, or
complex and its value is zero.
And for completeness, we need to include the logical type.
What is the exceptional value for logical? I guess false is
the better candidate.
On Tue, May 26, 2015 at 3:27 PM, Walt Brainerd <walt.brainerd at gmail.com>
wrote:
> I am willing to try this one more time.
>
> Tell me I am crazy, stupid, or whatever; it has happened before.
>
> But to ignore this puzzles me. Is anybody going to correct this error?
>
> 7.2.1.3(1) of the F08 standard says:
>
> No value is assigned to the variable if it is of type character and zero
> length, or is an array of size zero.
>
> It is still in N2014, if that is the latest.
>
> Consider the program:
>
> program f
> character(len=:), allocatable :: c
> c = ""
> print *, len(c), "X"//C//"X"
> c = "QQQ"
> print *, len(c), "X"//C//"X"
> end program f
>
> The sentence quoted says that the second assignment does not
> assign the value QQQ because the length of c is zero. I don't
> think that is what is intended.
>
> Just delete the sentence' it was silly, but wasn't wrong in F95.
>
> --
> Walt Brainerd
>
--
Walt Brainerd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.j3-fortran.org/pipermail/j3/attachments/20150616/a43bd023/attachment.html
More information about the J3
mailing list