Compiling the following code (named constant_warning.for) results in unexpected warnings:
REAL*8 x
REAL*4 y
x=10000000.0
x=10000000.0_4
x=10000000.0_8
y=10000000.0
y=10000000.0_4
y=10000000.0_8
write(*,*) x,y
end
. Compiling with ftn95 version 8.60 via
ftn95 constant_warning.for /ALT_KINDS
results in warnings
c:\ds\samples\salford_8.60>ftn95 constant_warning.for /ALT_KINDS
[FTN95/Win32 Ver. 8.60.0 Copyright (c) Silverfrost Ltd 1993-2019]
Licensed to: Dipl.-Ing. H. Stapelfeldt
Organisation: Stapelfeldt Ingenieurgesellsch. mbH
0003) x=10000000.0
WARNING - A REAL constant has been truncated with possible loss of precision -
maybe a KIND is required
0006) y=10000000.0
WARNING - A REAL constant has been truncated with possible loss of precision -
maybe a KIND is required
NO ERRORS, 2 WARNINGS [<main program> FTN95 v8.60.0]
which are unexpected to me. This happens, as well, if adding option /64 to the compile options.
Moreover, in the same situation the INTEL compiler ifort (64 bit) does not complain and displays no warning. Nor does ftn95 version 7.10 complain in this situation (and displays no warning).
Is there an explanation for the warnings? I am unsure if I should pay attention to the warnings. If not, how would I force ftn95 to not show them?
Thanks, Dietmar