[J3] an amusing mistake
Robert Corbett
rpcorbett at att.net
Tue Aug 4 07:29:05 EDT 2020
In the past few days, I had reasons to read
the Fortran 2018 standard more closely than
I usually read it. As often happens when I
read the standard closely, I saw problems
that I overlooked before. Yesterday, I saw
a problem I found amusing. (Yes, I am
easily amused.)
Consider the two programs
-------------------------------------------
PROGRAM ONE
CHARACTER*1, C(SUM([1]))
END
-------------------------------------------
PROGRAM TWO
CHARACTER*1, C(SUM([INTEGER:: 1])
END
-------------------------------------------
The first program is standard conforming.
The second program is not a conforming
program under a strict reading of the
standard. Both programs should be
standard conforming.
I suspect there are compilers that
accept both programs and other compilers
that reject both programs. I doubt there
are any compilers that accept the first
program and reject the second.
Bob Corbett
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20200804/d67ad6c0/attachment.htm>
More information about the J3
mailing list