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 2020/11/22 03:38:54 UTC

[incubator-nuttx] 16/22: libs/libc/modlib/modlib_symbols.c: Fix syslog formats

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

commit 34cd44f8d7df19eece6420babaceda64ae971f06
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Sun Nov 22 10:15:04 2020 +0900

    libs/libc/modlib/modlib_symbols.c: Fix syslog formats
---
 libs/libc/modlib/modlib_symbols.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/libs/libc/modlib/modlib_symbols.c b/libs/libc/modlib/modlib_symbols.c
index 3082db2..3d3fd43 100644
--- a/libs/libc/modlib/modlib_symbols.c
+++ b/libs/libc/modlib/modlib_symbols.c
@@ -24,6 +24,8 @@
 
 #include <nuttx/config.h>
 
+#include <inttypes.h>
+#include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
@@ -366,7 +368,7 @@ int modlib_symvalue(FAR struct module_s *modp,
                                       (FAR void *)&exportinfo);
         if (ret < 0)
           {
-            berr("ERROR: modlib_symcallback failed: \n", ret);
+            berr("ERROR: modlib_symcallback failed: %d\n", ret);
             return ret;
           }
 
@@ -401,9 +403,11 @@ int modlib_symvalue(FAR struct module_s *modp,
          * entry
          */
 
-        binfo("SHN_UNDEF: name=%s %08x+%08x=%08x\n",
-              loadinfo->iobuffer, sym->st_value, symbol->sym_value,
-              sym->st_value + symbol->sym_value);
+        binfo("SHN_UNDEF: name=%s "
+              "%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));
 
         sym->st_value += ((uintptr_t)symbol->sym_value);
       }
@@ -413,8 +417,9 @@ int modlib_symvalue(FAR struct module_s *modp,
       {
         secbase = loadinfo->shdr[sym->st_shndx].sh_addr;
 
-        binfo("Other: %08x+%08x=%08x\n",
-              sym->st_value, secbase, sym->st_value + secbase);
+        binfo("Other: %08" PRIxPTR "+%08" PRIxPTR "=%08" PRIxPTR "\n",
+              (uintptr_t)sym->st_value, secbase,
+              (uintptr_t)(sym->st_value + secbase));
 
         sym->st_value += secbase;
       }