Skip to content

Commit 093ca1f

Browse files
committed
libbacktrace: avoid void * pointer arithmetic
Git's DEVELOPER CFLAGS do not allow it. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 2461a33 commit 093ca1f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compat/libbacktrace/pecoff.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ coff_add (struct backtrace_state *state, int descriptor,
648648
magic_ok = memcmp (magic, "PE\0", 4) == 0;
649649
fhdr_off += 4;
650650

651-
memcpy (&fhdr, fhdr_view.data + 4, sizeof fhdr);
651+
memcpy (&fhdr, ((char *)fhdr_view.data) + 4, sizeof fhdr);
652652
}
653653
else
654654
{
@@ -682,7 +682,7 @@ coff_add (struct backtrace_state *state, int descriptor,
682682
sects_view_valid = 1;
683683
opt_hdr = (const b_coff_optional_header *) sects_view.data;
684684
sects = (const b_coff_section_header *)
685-
(sects_view.data + fhdr.size_of_optional_header);
685+
(((char *)sects_view.data) + fhdr.size_of_optional_header);
686686

687687
is_64 = 0;
688688
if (fhdr.size_of_optional_header > sizeof (*opt_hdr))
@@ -726,7 +726,7 @@ coff_add (struct backtrace_state *state, int descriptor,
726726
goto fail;
727727
syms_view_valid = 1;
728728

729-
str_size = coff_read4 (syms_view.data + syms_size);
729+
str_size = coff_read4 ((unsigned char *)syms_view.data + syms_size);
730730

731731
str_off = syms_off + syms_size;
732732

0 commit comments

Comments
 (0)