[patch, fortran] PR 47659 - extend conversion warnings to assignments

Thomas Koenig tkoenig@netcologne.de
Sun Aug 21 11:21:00 GMT 2011


Hello everybody,

now that I have found a little time, here is an updated version of
the patch, which incorporates Tobias' suggestions.  Regression-tested.

OK for trunk?

	Thomas

2011-08-21  Thomas Koenig  <tkoenig@gcc.gnu.org>

         PR fortran/47659
         * expr.c (gfc_check_assign): Check for type conversions when the
         right-hand side is a constant REAL/COMPLEX contstant the left-hand
         side is also REAL/COMPLEX.  Don't warn when a narrowing conversion
         for REAL does not change the value of the constant.

2011-08-21  Thomas Koenig  <tkoenig@gcc.gnu.org>

         PR fortran/47659
         * gfortran.dg/warn_conversion_2.f90:  Also warn about conversion
         of a constant resulting from simplification.
         * gfortran.dg/warn_conversion_3.f90:  New test.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: warn_conversion_3.f90
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20110821/fc8e153b/attachment.f90>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p3.diff
Type: text/x-patch
Size: 2542 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20110821/fc8e153b/attachment.bin>


More information about the Fortran mailing list