diff options
author | Daniel Jacobowitz <drow@false.org> | 2004-09-21 20:44:23 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2004-09-21 20:44:23 +0000 |
commit | eb4a223d0a7351b3d908a258f1e27b6250931902 (patch) | |
tree | 7cce7b6eb47790ba96ebe968a3e9430d83025067 /gdb/valarith.c | |
parent | 62521f270583571249fd24d81d70e28d7a8e7e36 (diff) | |
download | binutils-drow_intercu-20040221-branch.zip binutils-drow_intercu-20040221-branch.tar.gz binutils-drow_intercu-20040221-branch.tar.bz2 |
Merge from mainline.drow_intercu-20040221-branch
Diffstat (limited to 'gdb/valarith.c')
-rw-r--r-- | gdb/valarith.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gdb/valarith.c b/gdb/valarith.c index 7858f91..f88701f 100644 --- a/gdb/valarith.c +++ b/gdb/valarith.c @@ -202,7 +202,10 @@ value_subscript (struct value *array, struct value *idx) LONGEST index = value_as_long (idx); if (index >= lowerbound && index <= upperbound) return value_subscripted_rvalue (array, idx, lowerbound); - warning ("array or string index out of range"); + /* Emit warning unless we have an array of unknown size. + An array of unknown size has lowerbound 0 and upperbound -1. */ + if (upperbound > -1) + warning ("array or string index out of range"); /* fall doing C stuff */ c_style = 1; } |