(convert_for_assignment): Use `convert_and_check',
authorPaul Eggert <eggert@gnu.org>
Mon, 12 Jul 1993 21:10:27 +0000 (21:10 +0000)
committerPaul Eggert <eggert@gnu.org>
Mon, 12 Jul 1993 21:10:27 +0000 (21:10 +0000)
not `convert', for converting arithmetic types, since
`convert_and_check' no longer reports an error
where it should just warn.

From-SVN: r4910

gcc/c-typeck.c

index 68c894661449b14c13e1b61963ff70539b9ccec3..8ff4da5524fc130e296b1650904747a7951165a6 100644 (file)
@@ -4178,11 +4178,7 @@ convert_for_assignment (type, rhs, errtype, fundecl, funname, parmnum)
        &&
       (coder == INTEGER_TYPE || coder == REAL_TYPE || coder == ENUMERAL_TYPE
        || codel == COMPLEX_TYPE))
-    /* Don't use convert_and_check here.  If the input has type int
-       and did not overflow, and we are converting it here to a short,
-       we don't want an error.  A warning would be okay, but it's too risky now
-       to add an option to convert_and_check to get just warnings.  */
-    return convert (type, rhs);
+    return convert_and_check (type, rhs);
   /* Conversion to a union from its member types.  */
   else if (codel == UNION_TYPE)
     {