This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/27866] Warn when casting, e.g. assigning a double precision to a real
- From: "manu at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Feb 2007 15:47:24 -0000
- Subject: [Bug fortran/27866] Warn when casting, e.g. assigning a double precision to a real
- References: <bug-27866-1719@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from manu at gcc dot gnu dot org 2007-02-14 15:47 -------
(In reply to comment #1)
> (In reply to comment #0)
> > 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.
>
> There is -Wconversion, but this also warns the wrong way around.
There is a new -Wconversion implementation. Perhaps you could do the same for
fortran as I did for C/C++. Take a look at c-common.c (conversion_warnings). It
would be great if -Wconversion behaves the same way (more or less) in all
front-ends.
--
manu at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |manu at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27866