> Interesting example. > > % gfcx -o z a.f90 && ./z > -128 > % gfcx -o z -pedantic a.f90 && ./z > a.f90:5:20: > > 5 | data j /-128_int8/ > | 1 > Error: Integer too big for its kind at (1). This check can be disabled with > the option ‘-fno-range-check’
That qualifies as a compiler bug, I think. Our documentation for -pedantic states: “Issue warnings for uses of extensions to Fortran.” and "Valid Fortran programs should compile properly with or without this option.” The same is true of the following, which is also valid Fortran since 95 : use iso_fortran_env implicit none complex, parameter :: z = (-128_int8, -128_int8) print *, z end Right now it fails to compile with -pedantic. Or are they illegal because of how the range should be be symmetric? I can’t quite find the language in the standard for that, actually. To me, they’re valid signed-int-literal-constant. FX PS: I’m going to ignore the cases of the P and DT edit descriptors, because they’re not allowed to have a kind value, and therefore the corner cases occur for values too big to be actually relevant to anything.