From: Mark Wielaard Date: Fri, 25 May 2018 13:46:09 +0000 (+0200) Subject: __libdw_cu_addr_base: Cast offset to uintptr_t before returning as pointer. X-Git-Tag: elfutils-0.171~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=059b6b1b612f04e1d8f447b080d2ecbd37fc011d;p=thirdparty%2Felfutils.git __libdw_cu_addr_base: Cast offset to uintptr_t before returning as pointer. Fixes a GCC compile issue on the elfutils-debian-i686 buildbot builder: dwarf_getlocation_attr.c: In function ‘addr_valp’: dwarf_getlocation_attr.c:62:12: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] return (unsigned char *) offset; ^ cc1: all warnings being treated as errors Signed-off-by: Mark Wielaard --- diff --git a/libdw/ChangeLog b/libdw/ChangeLog index 526c91f43..fd59a2472 100644 --- a/libdw/ChangeLog +++ b/libdw/ChangeLog @@ -1,3 +1,8 @@ +2018-05-25 Mark Wielaard + + * dwarf_getlocation_attr.c (__libdw_cu_addr_base): Cast offset to + uintptr_t before returning as pointer. + 2018-05-22 Mark Wielaard * dwarf_getlocation.c (__libdw_cu_base_address): Treat errors of diff --git a/libdw/dwarf_getlocation_attr.c b/libdw/dwarf_getlocation_attr.c index 62ef47abf..9d7fd4b58 100644 --- a/libdw/dwarf_getlocation_attr.c +++ b/libdw/dwarf_getlocation_attr.c @@ -59,7 +59,7 @@ addr_valp (Dwarf_CU *cu, Dwarf_Word index) Dwarf_Word offset = __libdw_cu_addr_base (cu) + (index * cu->address_size); if (debug_addr == NULL) /* This is really an error, will trigger with dwarf_formaddr. */ - return (unsigned char *) offset; + return (unsigned char *) (uintptr_t) offset; return (unsigned char *) debug_addr->d_buf + offset; }