]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
trace: Fix compiler warning on 32-bit builds with bfd support
authorJouni Malinen <j@w1.fi>
Tue, 6 Jan 2015 09:46:46 +0000 (11:46 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 6 Jan 2015 16:30:20 +0000 (18:30 +0200)
With CONFIG_WPA_TRACE_BFD, the type cast from void* to integer was
generating a compiler warning due to the target integer being larger in
size in case of 32-bit builds. Type case to bfd_hostptr_t instead of
directly to bfd_vma to avoid this.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/utils/trace.c

index 7403c08f1aeb7a468991878be04b7cd990f22ec0..14fa40e11d6b891c805368811afe1a5f748095ac 100644 (file)
@@ -160,7 +160,7 @@ static void wpa_trace_bfd_addr(void *pc)
        if (abfd == NULL)
                return;
 
-       data.pc = (bfd_vma) pc;
+       data.pc = (bfd_hostptr_t) pc;
        data.found = FALSE;
        bfd_map_over_sections(abfd, find_addr_sect, &data);
 
@@ -201,7 +201,7 @@ static const char * wpa_trace_bfd_addr2func(void *pc)
        if (abfd == NULL)
                return NULL;
 
-       data.pc = (bfd_vma) pc;
+       data.pc = (bfd_hostptr_t) pc;
        data.found = FALSE;
        bfd_map_over_sections(abfd, find_addr_sect, &data);