[PATCH] libdl: Fix warnings on 64bit architectures

chrisj at rtems.org chrisj at rtems.org
Wed Aug 3 06:59:19 UTC 2022


From: Chris Johns <chrisj at rtems.org>

Updates #4662
---
 cpukit/libdl/rtl-elf.c        | 2 +-
 cpukit/libdl/rtl-obj-comp.c   | 6 +++---
 cpukit/libdl/rtl-shell.c      | 4 ++--
 cpukit/libdl/rtl-unresolved.c | 2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/cpukit/libdl/rtl-elf.c b/cpukit/libdl/rtl-elf.c
index 37d9f4575e..8a21c5df73 100644
--- a/cpukit/libdl/rtl-elf.c
+++ b/cpukit/libdl/rtl-elf.c
@@ -1171,7 +1171,7 @@ rtems_rtl_elf_symbols_load (rtems_rtl_obj*      obj,
         rtems_chain_set_off_chain (&osym->node);
         memcpy (string, name, strlen (name) + 1);
         osym->name = string;
-        osym->value = (uint8_t*) value;
+        osym->value = (void*) (intptr_t) value;
         osym->data = symbol.st_shndx;
 
         if (rtems_rtl_trace (RTEMS_RTL_TRACE_SYMBOL))
diff --git a/cpukit/libdl/rtl-obj-comp.c b/cpukit/libdl/rtl-obj-comp.c
index ea408527b7..001d416e80 100644
--- a/cpukit/libdl/rtl-obj-comp.c
+++ b/cpukit/libdl/rtl-obj-comp.c
@@ -115,7 +115,7 @@ rtems_rtl_obj_comp_read (rtems_rtl_obj_comp* comp,
   }
 
   if (rtems_rtl_trace (RTEMS_RTL_TRACE_COMP))
-    printf ("rtl:  comp: %2d: fd=%d length=%zu level=%u offset=%" PRIdoff_t " area=[%"
+    printf ("rtl:  comp: %2d: fd=%d length=%zu level=%zu offset=%" PRIdoff_t " area=[%"
             PRIdoff_t ",%" PRIdoff_t "] read=%" PRIu32 " size=%zu\n",
             comp->fd, comp->cache->fd, length, comp->level, comp->offset,
             comp->offset, comp->offset + length,
@@ -143,7 +143,7 @@ rtems_rtl_obj_comp_read (rtems_rtl_obj_comp* comp,
       if ((comp->level - buffer_level) != 0)
       {
         if (rtems_rtl_trace (RTEMS_RTL_TRACE_COMP))
-          printf ("rtl:  comp: copy-down: level=%u length=%zu\n",
+          printf ("rtl:  comp: copy-down: level=%zu length=%zu\n",
                   comp->level, comp->level - buffer_level);
 
         memmove (comp->buffer,
@@ -221,7 +221,7 @@ rtems_rtl_obj_comp_read (rtems_rtl_obj_comp* comp,
 
       if (rtems_rtl_trace (RTEMS_RTL_TRACE_COMP))
         printf ("rtl:  comp: expand: offset=%" PRIdoff_t \
-                " level=%u read=%" PRIu32 "\n",
+                " level=%zu read=%" PRIu32 "\n",
                 comp->offset, comp->level, comp->read);
     }
   }
diff --git a/cpukit/libdl/rtl-shell.c b/cpukit/libdl/rtl-shell.c
index 732f66131e..69de6bad83 100644
--- a/cpukit/libdl/rtl-shell.c
+++ b/cpukit/libdl/rtl-shell.c
@@ -406,7 +406,7 @@ typedef struct
   const rtems_rtl_obj_print* print;     /**< The print data. */
   bool                       first;     /**< Is this the first line printed. */
   bool                       show_name; /**< Show the object name. */
-  size_t                     indent;    /**< The indent. */
+  int                        indent;    /**< The indent. */
 } rtems_rtl_dep_data;
 
 static bool
@@ -849,7 +849,7 @@ rtems_rtl_shell_archive (const rtems_printer* printer, int argc, char* argv[])
 
   while (!rtems_chain_is_tail (&rtl->archives.archives, node))
   {
-    #define SYM_DUPLICATE (1 << ((8 * sizeof (size_t)) - 1))
+    #define SYM_DUPLICATE (((size_t) 1) << ((8 * sizeof (size_t)) - 1))
 
     rtems_rtl_archive* archive = (rtems_rtl_archive*) node;
 
diff --git a/cpukit/libdl/rtl-unresolved.c b/cpukit/libdl/rtl-unresolved.c
index a774c7f1c9..43a05e9887 100644
--- a/cpukit/libdl/rtl-unresolved.c
+++ b/cpukit/libdl/rtl-unresolved.c
@@ -810,8 +810,8 @@ rtems_rtl_unresolved_dump_iterator (rtems_rtl_unresolv_rec* rec,
   case rtems_rtl_trampoline_reloc:
     if (dd->show_relocs)
       printf (" %3zu: 2:reloc%c: obj:%s name:%2d: sect:%d\n",
-              rec->type == rtems_rtl_unresolved_reloc ? 'R' : 'T',
               dd->rec,
+              rec->type == rtems_rtl_unresolved_reloc ? 'R' : 'T',
               rec->rec.reloc.obj == NULL ? "resolved" : rec->rec.reloc.obj->oname,
               rec->rec.reloc.name,
               rec->rec.reloc.sect);
-- 
2.24.1



More information about the devel mailing list