This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/27866] New: Warn when casting, e.g. assigning a double precision to a real
- From: "tobias dot burnus at physik dot fu-berlin dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Jun 2006 18:49:25 -0000
- Subject: [Bug fortran/27866] New: Warn when casting, e.g. assigning a double precision to a real
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
In the following program there is clearly a problem with the "r = d"
assignment. In most real programs such drastic case does not happen. However,
simple precision loss or worse things may occure.
gfortran -Wall should warn, but it does not deserve a default warning.
program test
double precision :: d
real :: r
d = 4d99
r = d
print *, d, r
end program test
g95 -Wall shows:
r = d
1
Warning (140): Implicit conversion at (1) may cause precision loss
--
Summary: Warn when casting, e.g. assigning a double precision to
a real
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: tobias dot burnus at physik dot fu-berlin dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27866