Allow short to be size_t
authorMichael Meissner <meissner@gcc.gnu.org>
Fri, 27 Sep 1996 17:49:57 +0000 (17:49 +0000)
committerMichael Meissner <meissner@gcc.gnu.org>
Fri, 27 Sep 1996 17:49:57 +0000 (17:49 +0000)
From-SVN: r12853

gcc/c-decl.c

index f1d3ba71a36f387e30e009d26d0fe43770284dcd..1eab9f39ab0be98fad8401b6ec5dcd4ba216f943 100644 (file)
@@ -2868,6 +2868,14 @@ init_decl_processing ()
   pushdecl (build_decl (TYPE_DECL, get_identifier ("long long unsigned int"),
                        long_long_unsigned_type_node));
 
+  short_integer_type_node = make_signed_type (SHORT_TYPE_SIZE);
+  pushdecl (build_decl (TYPE_DECL, get_identifier ("short int"),
+                       short_integer_type_node));
+
+  short_unsigned_type_node = make_unsigned_type (SHORT_TYPE_SIZE);
+  pushdecl (build_decl (TYPE_DECL, get_identifier ("short unsigned int"),
+                       short_unsigned_type_node));
+
   /* `unsigned long' is the standard type for sizeof.
      Traditionally, use a signed type.
      Note that stddef.h uses `unsigned long',
@@ -2887,18 +2895,12 @@ init_decl_processing ()
   TREE_TYPE (TYPE_SIZE (long_integer_type_node)) = sizetype;
   TREE_TYPE (TYPE_SIZE (long_long_integer_type_node)) = sizetype;
   TREE_TYPE (TYPE_SIZE (long_long_unsigned_type_node)) = sizetype;
+  TREE_TYPE (TYPE_SIZE (short_integer_type_node)) = sizetype;
+  TREE_TYPE (TYPE_SIZE (short_unsigned_type_node)) = sizetype;
 
   error_mark_node = make_node (ERROR_MARK);
   TREE_TYPE (error_mark_node) = error_mark_node;
 
-  short_integer_type_node = make_signed_type (SHORT_TYPE_SIZE);
-  pushdecl (build_decl (TYPE_DECL, get_identifier ("short int"),
-                       short_integer_type_node));
-
-  short_unsigned_type_node = make_unsigned_type (SHORT_TYPE_SIZE);
-  pushdecl (build_decl (TYPE_DECL, get_identifier ("short unsigned int"),
-                       short_unsigned_type_node));
-
   /* Define both `signed char' and `unsigned char'.  */
   signed_char_type_node = make_signed_type (CHAR_TYPE_SIZE);
   pushdecl (build_decl (TYPE_DECL, get_identifier ("signed char"),