]> gcc.gnu.org Git - gcc.git/commitdiff
(comptypes): An enum type if compatible with type of same signedness
authorRichard Kenner <kenner@gcc.gnu.org>
Fri, 6 May 1994 16:59:23 +0000 (12:59 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Fri, 6 May 1994 16:59:23 +0000 (12:59 -0400)
as well as precision.

From-SVN: r7227

gcc/c-typeck.c

index b1cb70b58d74f8f7ac2096eed9f6bebea70f61b3..5b491979ba487f7f3a137a361cd75369878174d9 100644 (file)
@@ -398,12 +398,13 @@ comptypes (type1, type2)
   if (t1 == t2 || TREE_CODE (t1) == ERROR_MARK || TREE_CODE (t2) == ERROR_MARK)
     return 1;
 
-  /* Treat an enum type as the unsigned integer type of the same width.  */
+  /* Treat an enum type as the integer type of the same width and 
+     signedness.  */
 
   if (TREE_CODE (t1) == ENUMERAL_TYPE)
-    t1 = type_for_size (TYPE_PRECISION (t1), 1);
+    t1 = type_for_size (TYPE_PRECISION (t1), TREE_UNSIGNED (t1));
   if (TREE_CODE (t2) == ENUMERAL_TYPE)
-    t2 = type_for_size (TYPE_PRECISION (t2), 1);
+    t2 = type_for_size (TYPE_PRECISION (t2), TREE_UNSIGNED (t2));
 
   if (t1 == t2)
     return 1;
This page took 0.0709 seconds and 5 git commands to generate.