mirror of
https://github.com/ianlancetaylor/libbacktrace.git
synced 2026-03-27 04:29:06 +08:00
libbacktrace: avoid -Wpointer-arith errors
Based on patch from Kirill Müller. * configure.ac (ACX_PROG_CC_WARNING_OPTS): Add -Wpointer-arith. * pecoff.c (coff_add): Cast void pointers. * xcoff.c (xcoff_add): Likewise. * configure: Regenerate.
This commit is contained in:
7
pecoff.c
7
pecoff.c
@@ -704,7 +704,7 @@ coff_add (struct backtrace_state *state, int descriptor,
|
||||
magic_ok = memcmp (magic, "PE\0", 4) == 0;
|
||||
fhdr_off += 4;
|
||||
|
||||
memcpy (&fhdr, fhdr_view.data + 4, sizeof fhdr);
|
||||
memcpy (&fhdr, (const unsigned char *) fhdr_view.data + 4, sizeof fhdr);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -738,7 +738,7 @@ coff_add (struct backtrace_state *state, int descriptor,
|
||||
sects_view_valid = 1;
|
||||
opt_hdr = (const b_coff_optional_header *) sects_view.data;
|
||||
sects = (const b_coff_section_header *)
|
||||
(sects_view.data + fhdr.size_of_optional_header);
|
||||
((const unsigned char *) sects_view.data + fhdr.size_of_optional_header);
|
||||
|
||||
is_64 = 0;
|
||||
memset (&image_base, 0, sizeof image_base);
|
||||
@@ -781,7 +781,8 @@ coff_add (struct backtrace_state *state, int descriptor,
|
||||
goto fail;
|
||||
syms_view_valid = 1;
|
||||
|
||||
str_size = coff_read4 (syms_view.data + syms_size);
|
||||
str_size = coff_read4 ((const unsigned char *) syms_view.data
|
||||
+ syms_size);
|
||||
|
||||
str_off = syms_off + syms_size;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user