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] Warn when casting, e.g. assigning a double precision to a real



------- 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


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