This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/27866] New: Warn when casting, e.g. assigning a double precision to a real


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]