This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Warning fix
- From: Andreas Schwab <schwab at suse dot de>
- To: gdb-patches at sources dot redhat dot com
- Date: Fri, 22 Nov 2002 17:32:57 +0100
- Subject: Warning fix
This silences a warning from gcc. Committed as obvious.
Andreas.
2002-11-22 Andreas Schwab <schwab@suse.de>
* valops.c (value_slice): Move declaration of `offset' to avoid
warning.
--- valops.c.~1.79.~ 2002-11-07 10:52:53.000000000 +0100
+++ valops.c 2002-11-22 17:10:12.000000000 +0100
@@ -3392,7 +3392,7 @@ struct value *
value_slice (struct value *array, int lowbound, int length)
{
struct type *slice_range_type, *slice_type, *range_type;
- LONGEST lowerbound, upperbound, offset;
+ LONGEST lowerbound, upperbound;
struct value *slice;
struct type *array_type;
array_type = check_typedef (VALUE_TYPE (array));
@@ -3443,7 +3443,7 @@ value_slice (struct value *array, int lo
else
{
struct type *element_type = TYPE_TARGET_TYPE (array_type);
- offset
+ LONGEST offset
= (lowbound - lowerbound) * TYPE_LENGTH (check_typedef (element_type));
slice_type = create_array_type ((struct type *) NULL, element_type,
slice_range_type);
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."