+2022-10-21 Yonggang Luo <luoyonggang@gmail.com>
+
+ * memory-access.h (get_uleb128_step): Use __typeof.
+ (get_sleb128_step): Likewise.
+ (__libdw_get_sleb128) Likewise.
+ (__libdw_get_sleb128_unchecked): Likewise.
+
2022-11-03 Mark Wielaard <mark@klomp.org>
* dwarf_next_cfi.c (dwarf_next_cfi): Don't dereference and assign
#define get_uleb128_step(var, addr, nth) \
do { \
unsigned char __b = *(addr)++; \
- (var) |= (typeof (var)) (__b & 0x7f) << ((nth) * 7); \
+ (var) |= (__typeof (var)) (__b & 0x7f) << ((nth) * 7); \
if (likely ((__b & 0x80) == 0)) \
return (var); \
} while (0)
#define get_sleb128_step(var, addr, nth) \
do { \
unsigned char __b = *(addr)++; \
- (var) |= (typeof (var)) (__b & 0x7f) << ((nth) * 7); \
+ (var) |= (__typeof (var)) (__b & 0x7f) << ((nth) * 7); \
if (likely ((__b & 0x80) == 0)) \
{ \
if ((__b & 0x40) != 0) \
- (var) |= - ((typeof (var)) 1 << (((nth) + 1) * 7)); \
+ (var) |= - ((__typeof (var)) 1 << (((nth) + 1) * 7)); \
return (var); \
} \
} while (0)
{
/* We only need the low bit of the final byte, and as it is the
sign bit, we don't need to do anything else here. */
- acc |= ((typeof (acc)) b) << 7 * max;
+ acc |= ((__typeof (acc)) b) << 7 * max;
return acc;
}
{
/* We only need the low bit of the final byte, and as it is the
sign bit, we don't need to do anything else here. */
- acc |= ((typeof (acc)) b) << 7 * max;
+ acc |= ((__typeof (acc)) b) << 7 * max;
return acc;
}