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

Tobias Burnus burnus@net-b.de
Sun Aug 14 20:54:00 GMT 2011


Thomas Koenig wrote:
> the attached patch extends conversion warnings to assignments.
> OK for trunk?

I get now two warnings for:

complex(8), parameter :: z = cmplx (0.5, 0.5)
r = z
end


Untested: Instead of checking

   if (rvalue->expr_type == EXPR_CONSTANT
&& (lvalue->ts.type == BT_REAL || lvalue->ts.type == BT_COMPLEX)
&& (rvalue->ts.type == BT_REAL || rvalue->ts.type == BT_COMPLEX))

one might check for:

   if (rvalue->expr_type == EXPR_CONSTANT
&& (lvalue->ts.type == BT_REAL || lvalue->ts.type == BT_COMPLEX)
&& (rvalue->ts.type ==rvalue->ts.type)

Tobias



More information about the Fortran mailing list