BOZ, F2008 and F2015, and future of gfortran
Steve Kargl
sgk@troutmask.apl.washington.edu
Thu Oct 5 21:10:00 GMT 2017
Simply question. Do people want gfortran to conform to
the F2008 and F2015 standards for boz-literal-constants?
Are people willing to let go of extension?
Consider
program boz
implicit none
integer(1) :: i = z'deadbeef' ! Nonstandard initialization but
integer(1) j ! accepted as-if initialized through
data j/z'deadbeef'/ ! a data-stmt
print *, i, j
end program boz
gfortran's current behavior with long lines wrap.
% gfortran6 -static -o z z.f90
z.f90:3:20:
integer(1) :: i = z'deadbeef'
1
Error: Arithmetic overflow converting INTEGER(16) to INTEGER(1) at (1).
This check can be disabled with the option '-fno-range-check'
z.f90:6:13:
print *, i, j
1
Error: Symbol 'i' at (1) has no IMPLICIT type
z.f90:5:21:
data j/z'deadbeef'/
1
Error: Arithmetic overflow converting INTEGER(16) to INTEGER(1) at (1).
This check can be disabled with the option '-fno-range-check'
A conforming version of
gfortran conforming to the F2008 and F2015 standards.
% gfcx -o z z.f90 && ./z
-17 -17
--
Steve
20170425 https://www.youtube.com/watch?v=VWUpyCsUKR4
20161221 https://www.youtube.com/watch?v=IbCHE-hONow
More information about the Fortran
mailing list