You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2022/09/28 12:35:38 UTC

[incubator-nuttx] branch master updated: libelf/libelf_symbols.c: Fix compilation warning about void* arithmetics

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 7c003162a6 libelf/libelf_symbols.c: Fix compilation warning about void* arithmetics
7c003162a6 is described below

commit 7c003162a6180fa01817fc622eefaec3639fba8e
Author: Ville Juven <vi...@unikie.com>
AuthorDate: Wed Sep 28 12:23:09 2022 +0300

    libelf/libelf_symbols.c: Fix compilation warning about void* arithmetics
    
    Fixes minor issue with a trace (build failure with -Werror):
    libelf/libelf_symbols.c:310:41: error: pointer of type 'void *' used in arithmetic [-Werror=pointer-arith]
      310 |               (uintptr_t)(sym->st_value + symbol->sym_value));
---
 binfmt/libelf/libelf_symbols.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/binfmt/libelf/libelf_symbols.c b/binfmt/libelf/libelf_symbols.c
index 1781f689d0..6247f00983 100644
--- a/binfmt/libelf/libelf_symbols.c
+++ b/binfmt/libelf/libelf_symbols.c
@@ -307,7 +307,7 @@ int elf_symvalue(FAR struct elf_loadinfo_s *loadinfo, FAR Elf_Sym *sym,
               "%08" PRIxPTR "+%08" PRIxPTR "=%08" PRIxPTR "\n",
               loadinfo->iobuffer, (uintptr_t)sym->st_value,
               (uintptr_t)symbol->sym_value,
-              (uintptr_t)(sym->st_value + symbol->sym_value));
+              (uintptr_t)(sym->st_value + (uintptr_t)symbol->sym_value));
 
         sym->st_value += ((uintptr_t)symbol->sym_value);
       }