]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
trace: Avoid void pointer arithmetic
authorJouni Malinen <jouni@codeaurora.org>
Wed, 24 Jul 2019 16:33:06 +0000 (19:33 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 24 Jul 2019 16:33:06 +0000 (19:33 +0300)
This is a compiler specific extension and not compliant with the C
standard.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/utils/trace.c

index e0b5b0bb99f52c8fe5eb057a52e91fda2801810f..40843432050e03c610a1ed999df7b5bef3dc309a 100644 (file)
@@ -186,7 +186,7 @@ static void wpa_trace_bfd_addr(void *pc)
        if (abfd == NULL)
                return;
 
-       data.pc = (bfd_hostptr_t) (pc - start_offset);
+       data.pc = (bfd_hostptr_t) ((u8 *) pc - start_offset);
        data.found = FALSE;
        bfd_map_over_sections(abfd, find_addr_sect, &data);
 
@@ -227,7 +227,7 @@ static const char * wpa_trace_bfd_addr2func(void *pc)
        if (abfd == NULL)
                return NULL;
 
-       data.pc = (bfd_hostptr_t) (pc - start_offset);
+       data.pc = (bfd_hostptr_t) ((u8 *) pc - start_offset);
        data.found = FALSE;
        bfd_map_over_sections(abfd, find_addr_sect, &data);
 
@@ -299,7 +299,7 @@ size_t wpa_trace_calling_func(const char *buf[], size_t len)
        for (i = 0; i < btrace_num; i++) {
                struct bfd_data data;
 
-               data.pc = (bfd_hostptr_t) (btrace_res[i] - start_offset);
+               data.pc = (bfd_hostptr_t) ((u8 *) btrace_res[i] - start_offset);
                data.found = FALSE;
                bfd_map_over_sections(abfd, find_addr_sect, &data);