diff options
author | Mark Wielaard <mjw@redhat.com> | 2013-09-30 00:39:07 +0200 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2013-09-30 00:39:13 +0200 |
commit | 74f9b7337562c06a93722ad757d258db8f082663 (patch) | |
tree | 11b05d94cc21f4f73e3ed862860c59efefb59052 /libdw/dwarf_getlocation.c | |
parent | b43bcfe4235d3fda3ea22d96af0f8f0c71924013 (diff) | |
download | elfutils-74f9b7337562c06a93722ad757d258db8f082663.tar.gz |
libdw: Fix compiler warnings on 32-bit.
Don't cast directly to/from Dwarf_Word (uint64_t) to/from pointers,
but use uintptr_t as intermediary to prevent cast to pointer from
integer of different size warnings.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
Diffstat (limited to 'libdw/dwarf_getlocation.c')
-rw-r--r-- | libdw/dwarf_getlocation.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libdw/dwarf_getlocation.c b/libdw/dwarf_getlocation.c index f7d64f41..ff25fc7c 100644 --- a/libdw/dwarf_getlocation.c +++ b/libdw/dwarf_getlocation.c @@ -99,7 +99,7 @@ store_implicit_value (Dwarf *dbg, void **cache, Dwarf_Op *op) { struct loc_block_s *block = libdw_alloc (dbg, struct loc_block_s, sizeof (struct loc_block_s), 1); - const unsigned char *data = (const unsigned char *) op->number2; + const unsigned char *data = (const unsigned char *) (uintptr_t) op->number2; Dwarf_Word blength; // Ignored, equal to op->number. get_uleb128 (blength, data); block->addr = op; @@ -414,7 +414,8 @@ __libdw_intern_expression (Dwarf *dbg, bool other_byte_order, if (unlikely (dbg == NULL)) goto invalid; - newloc->number2 = (Dwarf_Word) data; /* start of block inc. len. */ + /* start of block inc. len. */ + newloc->number2 = (Dwarf_Word) (uintptr_t) data; /* XXX Check size. */ get_uleb128 (newloc->number, data); /* Block length. */ if (unlikely ((Dwarf_Word) (end_data - data) < newloc->number)) @@ -447,7 +448,8 @@ __libdw_intern_expression (Dwarf *dbg, bool other_byte_order, if (unlikely (data >= end_data)) goto invalid; - newloc->number2 = (Dwarf_Word) data; /* start of block inc. len. */ + /* start of block inc. len. */ + newloc->number2 = (Dwarf_Word) (uintptr_t) data; size = *data++; if (unlikely ((Dwarf_Word) (end_data - data) < size)) goto invalid; |