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: 16 Feb 2007 21:08:53 -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 #5 from manu at gcc dot gnu dot org 2007-02-16 21:08 -------
(In reply to comment #4)
> (In reply to comment #3)
>
> > 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.
>
> This would be a good idea.
>
> Looking at the code from c-common.c, we should warn about
>
That is up to you. I don't know so much about fortran. I was just pointing to
the middle-end functions used in c-common.c to detect whether a value is
changed by the conversion. However, be careful about not warning in excess. For
example, constant integer division does not change any value, so I think it is
not appropriate for -Wconversion. But I guess that it is up to fortran
maintainers to make this decision.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27866