public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/27866]  New: Warn when casting, e.g. assigning a double precision to a real
@ 2006-06-01 18:49 tobias dot burnus at physik dot fu-berlin dot de
  2006-06-01 21:09 ` [Bug fortran/27866] " tkoenig at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: tobias dot burnus at physik dot fu-berlin dot de @ 2006-06-01 18:49 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-05-10 19:30 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-01 18:49 [Bug fortran/27866] New: Warn when casting, e.g. assigning a double precision to a real tobias dot burnus at physik dot fu-berlin dot de
2006-06-01 21:09 ` [Bug fortran/27866] " tkoenig at gcc dot gnu dot org
2006-06-07 19:56 ` tkoenig at gcc dot gnu dot org
2007-02-14 15:47 ` manu at gcc dot gnu dot org
2007-02-16 20:50 ` tkoenig at gcc dot gnu dot org
2007-02-16 21:09 ` manu at gcc dot gnu dot org
2007-02-18 21:19 ` tkoenig at gcc dot gnu dot org
2007-04-19 20:45 ` pinskia at gcc dot gnu dot org
2008-04-17 22:01 ` tkoenig at gcc dot gnu dot org
2010-05-10 17:12 ` dfranke at gcc dot gnu dot org
2010-05-10 19:30 ` dfranke at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).