__libdw_cu_addr_base: Cast offset to uintptr_t before returning as pointer.
authorMark Wielaard <mark@klomp.org>
Fri, 25 May 2018 13:46:09 +0000 (15:46 +0200)
committerMark Wielaard <mark@klomp.org>
Fri, 25 May 2018 13:47:15 +0000 (15:47 +0200)
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 <mark@klomp.org>
libdw/ChangeLog
libdw/dwarf_getlocation_attr.c

index 526c91f..fd59a24 100644 (file)
@@ -1,3 +1,8 @@
+2018-05-25  Mark Wielaard  <mark@klomp.org>
+
+       * dwarf_getlocation_attr.c (__libdw_cu_addr_base): Cast offset to
+       uintptr_t before returning as pointer.
+
 2018-05-22  Mark Wielaard  <mark@klomp.org>
 
        * dwarf_getlocation.c (__libdw_cu_base_address): Treat errors of
index 62ef47a..9d7fd4b 100644 (file)
@@ -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;
 }