Skip to content

Commit 6f88a40

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 5a8978b commit 6f88a40

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
@@ -653,7 +653,7 @@ coff_add (struct backtrace_state *state, int descriptor,
653653
magic_ok = memcmp (magic, "PE\0", 4) == 0;
654654
fhdr_off += 4;
655655

656-
memcpy (&fhdr, fhdr_view.data + 4, sizeof fhdr);
656+
memcpy (&fhdr, ((char *)fhdr_view.data) + 4, sizeof fhdr);
657657
}
658658
else
659659
{
@@ -687,7 +687,7 @@ coff_add (struct backtrace_state *state, int descriptor,
687687
sects_view_valid = 1;
688688
opt_hdr = (const b_coff_optional_header *) sects_view.data;
689689
sects = (const b_coff_section_header *)
690-
(sects_view.data + fhdr.size_of_optional_header);
690+
(((char *)sects_view.data) + fhdr.size_of_optional_header);
691691

692692
if (fhdr.size_of_optional_header > sizeof (*opt_hdr))
693693
{
@@ -727,7 +727,7 @@ coff_add (struct backtrace_state *state, int descriptor,
727727
goto fail;
728728
syms_view_valid = 1;
729729

730-
memcpy (&str_size, syms_view.data + syms_size, 4);
730+
memcpy (&str_size, ((char *)syms_view.data) + syms_size, 4);
731731

732732
str_off = syms_off + syms_size;
733733

0 commit comments

Comments
 (0)