Workaround a GCC warning about a pointer being cast to a larger
integral type. Use intptr which is designed to hold pointer values and pass it to off_t. mysys/stacktrace.c: Add a compile time assert to ensure that off_t is large enough to hold the pointer value.
This commit is contained in:
parent
d5e928959e
commit
cd504e49bc
@ -87,8 +87,11 @@ static int safe_print_str(const char *addr, int max_len)
|
||||
if ((fd= open(buf, O_RDONLY)) < 0)
|
||||
return -1;
|
||||
|
||||
/* Ensure that off_t can hold a pointer. */
|
||||
compile_time_assert(sizeof(off_t) >= sizeof(intptr));
|
||||
|
||||
total= max_len;
|
||||
offset= (off_t) addr;
|
||||
offset= (intptr) addr;
|
||||
|
||||
/* Read up to the maximum number of bytes. */
|
||||
while (total)
|
||||
|
Loading…
x
Reference in New Issue
Block a user