diff options
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r-- | gcc/fortran/expr.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index f0cfd18..35918a6 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -653,7 +653,8 @@ gfc_build_conversion (gfc_expr *e) /* Given an expression node with some sort of numeric binary expression, insert type conversions required to make the operands - have the same type. + have the same type. Conversion warnings are disabled if wconversion + is set to 0. The exception is that the operands of an exponential don't have to have the same type. If possible, the base is promoted to the type @@ -661,7 +662,7 @@ gfc_build_conversion (gfc_expr *e) 1.0**2 stays as it is. */ void -gfc_type_convert_binary (gfc_expr *e) +gfc_type_convert_binary (gfc_expr *e, int wconversion) { gfc_expr *op1, *op2; @@ -685,9 +686,9 @@ gfc_type_convert_binary (gfc_expr *e) } if (op1->ts.kind > op2->ts.kind) - gfc_convert_type (op2, &op1->ts, 2); + gfc_convert_type_warn (op2, &op1->ts, 2, wconversion); else - gfc_convert_type (op1, &op2->ts, 2); + gfc_convert_type_warn (op1, &op2->ts, 2, wconversion); e->ts = op1->ts; goto done; @@ -702,14 +703,14 @@ gfc_type_convert_binary (gfc_expr *e) if (e->value.op.op == INTRINSIC_POWER) goto done; - gfc_convert_type (e->value.op.op2, &e->ts, 2); + gfc_convert_type_warn (e->value.op.op2, &e->ts, 2, wconversion); goto done; } if (op1->ts.type == BT_INTEGER) { e->ts = op2->ts; - gfc_convert_type (e->value.op.op1, &e->ts, 2); + gfc_convert_type_warn (e->value.op.op1, &e->ts, 2, wconversion); goto done; } @@ -720,9 +721,9 @@ gfc_type_convert_binary (gfc_expr *e) else e->ts.kind = op2->ts.kind; if (op1->ts.type != BT_COMPLEX || op1->ts.kind != e->ts.kind) - gfc_convert_type (e->value.op.op1, &e->ts, 2); + gfc_convert_type_warn (e->value.op.op1, &e->ts, 2, wconversion); if (op2->ts.type != BT_COMPLEX || op2->ts.kind != e->ts.kind) - gfc_convert_type (e->value.op.op2, &e->ts, 2); + gfc_convert_type_warn (e->value.op.op2, &e->ts, 2, wconversion); done: return; |