diff options
author | Richard Stallman <rms@gnu.org> | 1993-01-26 06:51:31 +0000 |
---|---|---|
committer | Richard Stallman <rms@gnu.org> | 1993-01-26 06:51:31 +0000 |
commit | fba9adc6d59ec33d5c1bf08bae08a4627863eb68 (patch) | |
tree | d942a79213699a3f9e9f738f7f30b75683340623 | |
parent | 625bbc6074531d90a8a44df63de73af18f9e17aa (diff) | |
download | gcc-fba9adc6d59ec33d5c1bf08bae08a4627863eb68.zip gcc-fba9adc6d59ec33d5c1bf08bae08a4627863eb68.tar.gz gcc-fba9adc6d59ec33d5c1bf08bae08a4627863eb68.tar.bz2 |
(init_decl_processing): Use 10 as size of ..._array_type_node.
From-SVN: r3345
-rw-r--r-- | gcc/c-decl.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index f5d9b1d..4847d36 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -150,17 +150,17 @@ tree ptr_type_node, const_ptr_type_node; tree string_type_node, const_string_type_node; -/* Type `char[256]' or something like it. +/* Type `char[SOMENUMBER]'. Used when an array of char is needed and the size is irrelevant. */ tree char_array_type_node; -/* Type `int[256]' or something like it. +/* Type `int[SOMENUMBER]' or something like it. Used when an array of int needed and the size is irrelevant. */ tree int_array_type_node; -/* Type `wchar_t[256]' or something like it. +/* Type `wchar_t[SOMENUMBER]' or something like it. Used when a wide string literal is created. */ tree wchar_array_type_node; @@ -2495,6 +2495,7 @@ init_decl_processing () tree void_ftype_any; int wchar_type_size; tree temp; + tree array_domain_type; current_function_decl = NULL; named_labels = NULL; @@ -2655,18 +2656,22 @@ init_decl_processing () const_string_type_node = build_pointer_type (build_type_variant (char_type_node, 1, 0)); - /* make a type for arrays of 256 characters. - 256 is picked randomly because we have a type for integers from 0 to 255. + /* Make a type to be the domain of a few array types + whose domains don`t really matter. + 10 is small enough that it always fits in size_t. */ + array_domain_type = build_index_type (build_int_2 (10, 0)); + + /* make a type for arrays of characters. With luck nothing will ever really depend on the length of this array type. */ char_array_type_node - = build_array_type (char_type_node, unsigned_intQI_type_node); + = build_array_type (char_type_node, array_domain_type); /* Likewise for arrays of ints. */ int_array_type_node - = build_array_type (integer_type_node, unsigned_intQI_type_node); + = build_array_type (integer_type_node, array_domain_type); /* This is for wide string constants. */ wchar_array_type_node - = build_array_type (wchar_type_node, unsigned_intQI_type_node); + = build_array_type (wchar_type_node, array_domain_type); default_function_type = build_function_type (integer_type_node, NULL_TREE); |