[J3] Is this standard compliant
Steidel, Jon L
jon.l.steidel at intel.com
Thu Feb 3 22:32:17 UTC 2022
Hi Sidd,
It is not compliant. The relevant parts of the syntax rules that apply:
R1005 add-operand is [add-operand mult-op] mult-operand
R1004 mult-operand is level-1-expr [power-op mult-operand]
R1002 level-1-operand is [defined-unary-op] primary
R1001 primary is literal-constant
or (exrp)
R605 literal-constant is real-literal-constant
R714 real-literal-constant is significand [exponent-leter exponent] [ _ kind-param]
R715 significand is digit-string . [digit—string]
R713 signed-real-literal-constant is [ sign] real-literal-constant
-1. is a signed-literal-real-constant, which is not permitted in R605 as a primary. The conforming way to write this statement would be
print *, 10. * (-1.)
-jon
From: J3 <j3-bounces at mailman.j3-fortran.org> On Behalf Of Siddhartha Ghosh via J3
Sent: Thursday, February 3, 2022 2:35 PM
To: j3 at j3-fortran.org
Cc: Siddhartha Ghosh <sghosh at ucar.edu>
Subject: [J3] Is this standard compliant
Dear All,
Our flagship NWP code WRF has many many statements containing
"Unary operator following arithmetic operator" (e.g. 10.*-1. ) that Cray-ftn
fails to compile. While,
1. gfortran compiles with warning
2. ifort compiles fine
3. nvfortran compiles fine
My question is, is this allowed by the current standard ?
I am trying this tiny example as a test.
program tst
print *, 10.*-1.
end
Thanks,
--Sidd
--
Siddhartha Ghosh<https://staff.ucar.edu/users/sghosh>
Consulting Services Group<https://www2.cisl.ucar.edu/user-support/user-services-section#csg>
Computational and Information Systems Laboratory<https://www.cisl.ucar.edu/>
303-497-1230<tel:303-497-1230>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20220203/849856d1/attachment-0001.htm>
More information about the J3
mailing list