(convert_arguments): If PROMOTE_PROTOTYPE, promote all integral types
authorRichard Kenner <kenner@gcc.gnu.org>
Mon, 30 Aug 1993 20:14:26 +0000 (16:14 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Mon, 30 Aug 1993 20:14:26 +0000 (16:14 -0400)
shorter than int, including short enums.

From-SVN: r5229

gcc/c-typeck.c

index 65623a7aff8406fa5f50fca8c7798f6a2be75f79..3cea85d62e3d82bc3465429ba748b68c00496a98 100644 (file)
@@ -2042,7 +2042,8 @@ convert_arguments (typelist, values, name, fundecl)
              /* Rather than truncating and then reextending,
                 convert directly to int, if that's the type we will want.  */
              if (! flag_traditional
-                 && TREE_CODE (type) == INTEGER_TYPE
+                 && (TREE_CODE (type) == INTEGER_TYPE
+                     || TREE_CODE (type) == ENUMERAL_TYPE)
                  && (TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node)))
                type = integer_type_node;
 #endif
@@ -2145,7 +2146,8 @@ convert_arguments (typelist, values, name, fundecl)
                                                fundecl, name, parmnum + 1);
              
 #ifdef PROMOTE_PROTOTYPES
-             if (TREE_CODE (type) == INTEGER_TYPE
+             if ((TREE_CODE (type) == INTEGER_TYPE
+                  || TREE_CODE (type) == ENUMERAL_TYPE)
                  && (TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node)))
                parmval = default_conversion (parmval);
 #endif