Scot
2016-05-11 21:36:00 UTC
gfortran4.8 on FreeBSD 9.3 i386 seems to be skipping KIND=10 for
precision 16-18. I've check that C_LONG_DOUBLE is KIND=10 which is 12
bytes. But when the program below is compiled and run, it does not
detect that KIND=10 is valid for ik 16-18. What am I missing? I've not
seen this issue on any other system.
I would expect the output below, but on FreeBSD it skips 10 and goes to
16 instead:
C_LONG_DOUBLE: KIND, SIZEOF 10 12
precision 2 kind 4
precision 3 kind 4
precision 4 kind 4
precision 5 kind 4
precision 6 kind 4
precision 7 kind 8
precision 8 kind 8
precision 9 kind 8
precision 10 kind 8
precision 11 kind 8
precision 12 kind 8
precision 13 kind 8
precision 14 kind 8
precision 15 kind 8
precision 16 kind 10
precision 17 kind 10
precision 18 kind 10
precision 19 kind 16
precision 20 kind 16
PROGRAM main
USE ISO_C_BINDING
IMPLICIT NONE
INTEGER :: ik, k
REAL(C_LONG_DOUBLE) :: cld
PRINT*,"C_LONG_DOUBLE: KIND, SIZEOF",C_LONG_DOUBLE, sizeof(cld)
DO ik=2,20
k = SELECTED_REAL_KIND(ik)
print*,"precision",ik,"kind",k
IF (k .LE. 0) EXIT
ENDDO
END
precision 16-18. I've check that C_LONG_DOUBLE is KIND=10 which is 12
bytes. But when the program below is compiled and run, it does not
detect that KIND=10 is valid for ik 16-18. What am I missing? I've not
seen this issue on any other system.
I would expect the output below, but on FreeBSD it skips 10 and goes to
16 instead:
C_LONG_DOUBLE: KIND, SIZEOF 10 12
precision 2 kind 4
precision 3 kind 4
precision 4 kind 4
precision 5 kind 4
precision 6 kind 4
precision 7 kind 8
precision 8 kind 8
precision 9 kind 8
precision 10 kind 8
precision 11 kind 8
precision 12 kind 8
precision 13 kind 8
precision 14 kind 8
precision 15 kind 8
precision 16 kind 10
precision 17 kind 10
precision 18 kind 10
precision 19 kind 16
precision 20 kind 16
PROGRAM main
USE ISO_C_BINDING
IMPLICIT NONE
INTEGER :: ik, k
REAL(C_LONG_DOUBLE) :: cld
PRINT*,"C_LONG_DOUBLE: KIND, SIZEOF",C_LONG_DOUBLE, sizeof(cld)
DO ik=2,20
k = SELECTED_REAL_KIND(ik)
print*,"precision",ik,"kind",k
IF (k .LE. 0) EXIT
ENDDO
END