From 0e51ef9b6ae48f77f8bdd040f3b7cbff85c9d251 Mon Sep 17 00:00:00 2001 From: Richard Stallman Date: Mon, 4 May 1992 03:04:19 +0000 Subject: [PATCH] *** empty log message *** From-SVN: r879 --- gcc/c-typeck.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 70bebe4795a..464e5f483f9 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -1147,7 +1147,6 @@ build_array_ref (array, index) { tree rval, type; - index = default_conversion (index); if (index != error_mark_node && TREE_CODE (TREE_TYPE (index)) != INTEGER_TYPE) { @@ -1165,6 +1164,9 @@ build_array_ref (array, index) && TYPE_MAIN_VARIANT (TREE_TYPE (index)) == char_type_node) warning ("array subscript has type `char'"); + /* Apply default promotions *after* noticing character types. */ + index = default_conversion (index); + /* An array that is indexed by a non-constant cannot be stored in a register; we must be able to do address arithmetic on its address. -- 2.30.2