(convert_for_assignment): Don't use convert_and_check
authorRichard Stallman <rms@gnu.org>
Thu, 6 May 1993 16:02:40 +0000 (16:02 +0000)
committerRichard Stallman <rms@gnu.org>
Thu, 6 May 1993 16:02:40 +0000 (16:02 +0000)
when handling arithmetic types here.

From-SVN: r4358

gcc/c-typeck.c

index 9a4cdec1b6c7b03c52b40f047d5b925d4ea20f61..088e877403aa4437c9d4a2105081273f7155c647 100644 (file)
@@ -4148,7 +4148,11 @@ convert_for_assignment (type, rhs, errtype, fundecl, funname, parmnum)
        &&
       (coder == INTEGER_TYPE || coder == REAL_TYPE || coder == ENUMERAL_TYPE
        || codel == COMPLEX_TYPE))
-    return convert_and_check (type, rhs);
+    /* 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);
   /* Conversion to a union from its member types.  */
   else if (codel == UNION_TYPE)
     {