(check_format_info): Consider "char", "signed char", and "unsigned
authorRichard Kenner <kenner@gcc.gnu.org>
Thu, 21 Oct 1993 01:44:35 +0000 (21:44 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Thu, 21 Oct 1993 01:44:35 +0000 (21:44 -0400)
char" types as equivalent.

From-SVN: r5849

gcc/c-common.c

index b6bc0e47f79c1f30db86113b25c3c68f38e35d9e..86f4ed7a4664ba9efba3f20dffb1ddfeda069288 100644 (file)
@@ -899,7 +899,12 @@ check_format_info (info, params)
               && TREE_CODE (cur_type) == INTEGER_TYPE
               && (TREE_UNSIGNED (wanted_type)
                   ? wanted_type == unsigned_type (cur_type)
-                  : wanted_type == signed_type (cur_type))))
+                  : wanted_type == signed_type (cur_type)))
+         /* Likewise, "signed char", "unsigned char" and "char" are
+            equivalent but the above test won't consider them equivalent.  */
+         && ! (wanted_type == char_type_node
+               && (cur_type == signed_char_type_node
+                   || cur_type == unsigned_char_type_node)))
        {
          register char *this;
          register char *that;