diff options
author | Richard Stallman <rms@gnu.org> | 1992-05-04 03:04:19 +0000 |
---|---|---|
committer | Richard Stallman <rms@gnu.org> | 1992-05-04 03:04:19 +0000 |
commit | 0e51ef9b6ae48f77f8bdd040f3b7cbff85c9d251 (patch) | |
tree | fcaa00b4cde57eb0f127aa7c297d0925dda8dd35 /gcc | |
parent | dce838e17dd6494f9a54d1aa86d247ad1403ccd4 (diff) | |
download | gcc-0e51ef9b6ae48f77f8bdd040f3b7cbff85c9d251.zip gcc-0e51ef9b6ae48f77f8bdd040f3b7cbff85c9d251.tar.gz gcc-0e51ef9b6ae48f77f8bdd040f3b7cbff85c9d251.tar.bz2 |
*** empty log message ***
From-SVN: r879
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/c-typeck.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 70bebe4..464e5f4 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. |