<div dir="auto">I'm ok with these but which were actually causing trouble?</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Aug 26, 2022, 8:12 PM  <<a href="mailto:chrisj@rtems.org">chrisj@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Chris Johns <<a href="mailto:chrisj@rtems.org" target="_blank" rel="noreferrer">chrisj@rtems.org</a>><br>
<br>
Closes #4709<br>
---<br>
 cpukit/include/link_elf.h                     |  8 ++++++++<br>
 cpukit/include/linux/rbtree.h                 | 10 +++++++++-<br>
 cpukit/include/rtems/capture.h                |  4 ++--<br>
 cpukit/include/rtems/posix/muteximpl.h        |  7 +++----<br>
 cpukit/include/rtems/posix/pthreadattrimpl.h  |  2 +-<br>
 cpukit/include/rtems/rtl/rtl-obj.h            | 20 +++++++++++++++----<br>
 cpukit/include/rtems/rtl/rtl.h                |  2 +-<br>
 cpukit/include/rtems/score/priority.h         |  4 ++--<br>
 cpukit/include/rtems/score/priorityimpl.h     |  2 +-<br>
 cpukit/include/rtems/score/scheduleredfimpl.h |  4 ++--<br>
 cpukit/include/rtems/score/tls.h              |  2 +-<br>
 cpukit/include/rtems/score/watchdogimpl.h     |  2 +-<br>
 12 files changed, 47 insertions(+), 20 deletions(-)<br>
<br>
diff --git a/cpukit/include/link_elf.h b/cpukit/include/link_elf.h<br>
index 6cab3c2c7f..6483c021fd 100644<br>
--- a/cpukit/include/link_elf.h<br>
+++ b/cpukit/include/link_elf.h<br>
@@ -13,6 +13,10 @@<br>
 #include <stdint.h><br>
 #include <rtems/rtl/rtl-obj-fwd.h><br>
<br>
+#ifdef __cplusplus<br>
+extern "C" {<br>
+#endif<br>
+<br>
 enum sections<br>
 {<br>
   rap_text = 0,<br>
@@ -76,4 +80,8 @@ int _rtld_linkmap_add (rtems_rtl_obj* obj);<br>
  * Remove link map from the list.<br>
  */<br>
 void _rtld_linkmap_delete (rtems_rtl_obj* obj);<br>
+<br>
+#ifdef __cplusplus<br>
+}<br>
+#endif<br>
 #endif /* _LINK_ELF_H_ */<br>
diff --git a/cpukit/include/linux/rbtree.h b/cpukit/include/linux/rbtree.h<br>
index 8fc575240f..ec0fac1af9 100644<br>
--- a/cpukit/include/linux/rbtree.h<br>
+++ b/cpukit/include/linux/rbtree.h<br>
@@ -17,6 +17,10 @@<br>
<br>
 #include <rtems/score/rbtree.h><br>
<br>
+#ifdef __cplusplus<br>
+extern "C" {<br>
+#endif<br>
+<br>
 #define rb_node RBTree_Node<br>
<br>
 #define rb_left Node.rbe_left<br>
@@ -96,7 +100,7 @@ static inline struct rb_node *rb_last( struct rb_root *root )<br>
<br>
 static inline void rb_replace_node(<br>
   struct rb_node *victim,<br>
-  struct rb_node *replacement, <br>
+  struct rb_node *replacement,<br>
   struct rb_root *root<br>
 )<br>
 {<br>
@@ -138,4 +142,8 @@ static inline struct rb_node *rb_parent( struct rb_node *node )<br>
     node = next \<br>
   )<br>
<br>
+#ifdef __cplusplus<br>
+}<br>
+#endif<br>
+<br>
 #endif /* _LINUX_RBTREE_H */<br>
diff --git a/cpukit/include/rtems/capture.h b/cpukit/include/rtems/capture.h<br>
index c37d652211..4ab638ec24 100644<br>
--- a/cpukit/include/rtems/capture.h<br>
+++ b/cpukit/include/rtems/capture.h<br>
@@ -838,7 +838,7 @@ rtems_capture_task_flags (rtems_tcb* tcb)<br>
 static inline rtems_capture_control*<br>
 rtems_capture_task_control (rtems_tcb* tcb)<br>
 {<br>
-  return tcb->Capture.control;<br>
+  return (rtems_capture_control*) tcb->Capture.control;<br>
 }<br>
<br>
 /**<br>
@@ -853,7 +853,7 @@ rtems_capture_task_control (rtems_tcb* tcb)<br>
 static inline uint32_t<br>
 rtems_capture_task_control_flags (rtems_tcb* tcb)<br>
 {<br>
-  rtems_capture_control*  control = tcb->Capture.control;<br>
+  rtems_capture_control*  control = rtems_capture_task_control (tcb);<br>
   if (!control)<br>
     return 0;<br>
   return control->flags;<br>
diff --git a/cpukit/include/rtems/posix/muteximpl.h b/cpukit/include/rtems/posix/muteximpl.h<br>
index 435b43634d..3d717420f2 100644<br>
--- a/cpukit/include/rtems/posix/muteximpl.h<br>
+++ b/cpukit/include/rtems/posix/muteximpl.h<br>
@@ -2,8 +2,8 @@<br>
  * @file<br>
  *<br>
  * @brief Private Inlined Routines for POSIX Mutex's.<br>
- * <br>
- * This include file contains the static inline implementation of the private <br>
+ *<br>
+ * This include file contains the static inline implementation of the private<br>
  * inlined routines for POSIX mutex's.<br>
  */<br>
<br>
@@ -104,7 +104,7 @@ RTEMS_INLINE_ROUTINE POSIX_Mutex_Protocol _POSIX_Mutex_Get_protocol(<br>
   unsigned long flags<br>
 )<br>
 {<br>
-  return flags & POSIX_MUTEX_PROTOCOL_MASK;<br>
+  return (POSIX_Mutex_Protocol) (flags & POSIX_MUTEX_PROTOCOL_MASK);<br>
 }<br>
<br>
 RTEMS_INLINE_ROUTINE bool _POSIX_Mutex_Is_recursive(<br>
@@ -484,4 +484,3 @@ bool _POSIX_Mutex_Auto_initialization( POSIX_Mutex_Control *the_mutex );<br>
<br>
 #endif<br>
 /*  end of include file */<br>
-<br>
diff --git a/cpukit/include/rtems/posix/pthreadattrimpl.h b/cpukit/include/rtems/posix/pthreadattrimpl.h<br>
index b5e02ec1c7..7cd69142a6 100644<br>
--- a/cpukit/include/rtems/posix/pthreadattrimpl.h<br>
+++ b/cpukit/include/rtems/posix/pthreadattrimpl.h<br>
@@ -72,7 +72,7 @@ RTEMS_INLINE_ROUTINE void _POSIX_Threads_Get_sched_param_sporadic(<br>
 #if defined(RTEMS_POSIX_API)<br>
   const POSIX_API_Control *api;<br>
<br>
-  api = the_thread->API_Extensions[ THREAD_API_POSIX ];<br>
+  api = (const POSIX_API_Control*) the_thread->API_Extensions[ THREAD_API_POSIX ];<br>
   param->sched_ss_low_priority = _POSIX_Priority_From_core(<br>
     scheduler,<br>
     api->Sporadic.Low_priority.priority<br>
diff --git a/cpukit/include/rtems/rtl/rtl-obj.h b/cpukit/include/rtems/rtl/rtl-obj.h<br>
index f27ae3259d..c1fe51306b 100644<br>
--- a/cpukit/include/rtems/rtl/rtl-obj.h<br>
+++ b/cpukit/include/rtems/rtl/rtl-obj.h<br>
@@ -231,7 +231,7 @@ struct rtems_rtl_obj<br>
   size_t              tramps_size;  /**< Size of the trampoline memory. */<br>
   void*               tramp_brk;    /**< Trampoline memory allocator. MD<br>
                                      *   relocators can take memory from the<br>
-                                     *   break upto the size. */<br>
+                                     *   break up to the size. */<br>
   size_t              tramp_relocs; /**< Number of slots reserved for<br>
                                      *   relocs. The remainder are for<br>
                                      *   unresolved symbols. */<br>
@@ -333,7 +333,7 @@ static inline bool rtems_rtl_obj_text_inside (const rtems_rtl_obj* obj,<br>
 {<br>
   return<br>
     (address >= obj->text_base) &&<br>
-    (address < (obj->text_base + obj->text_size));<br>
+    ((char*) address < ((char*) obj->text_base + obj->text_size));<br>
 }<br>
<br>
 /**<br>
@@ -367,6 +367,18 @@ static inline bool rtems_rtl_obj_has_symbol (const rtems_rtl_obj*     obj,<br>
           sym < (obj->global_table + obj->global_syms));<br>
 }<br>
<br>
+/**<br>
+ * Is there space in the trampoline memory for a trapoline.<br>
+ *<br>
+ * @param obj The object file's descriptor to check for available space.<br>
+ * @param size The size to be allocated.<br>
+ * @retval bool Returns @true if the space is available.<br>
+ */<br>
+static inline size_t rtems_rtl_obj_tramp_avail_space (const rtems_rtl_obj* obj)<br>
+{<br>
+  return (char*) obj->tramp_brk - (char*) obj->trampoline;<br>
+}<br>
+<br>
 /**<br>
  * Is there space in the trampoline memory for a trapoline.<br>
  *<br>
@@ -378,7 +390,7 @@ static inline bool rtems_rtl_obj_has_tramp_space (const rtems_rtl_obj* obj,<br>
                                                   const size_t         size)<br>
 {<br>
   return (obj->trampoline != NULL &&<br>
-          ((obj->tramp_brk - obj->trampoline) + size) <= obj->tramps_size);<br>
+          (rtems_rtl_obj_tramp_avail_space (obj) + size) <= obj->tramps_size);<br>
 }<br>
<br>
 /**<br>
@@ -402,7 +414,7 @@ static inline size_t rtems_rtl_obj_trampoline_slots (const rtems_rtl_obj* obj)<br>
 static inline size_t rtems_rtl_obj_trampolines (const rtems_rtl_obj* obj)<br>
 {<br>
   return obj->trampoline == NULL || obj->tramp_size == 0 ?<br>
-    0 : (obj->tramp_brk - obj->trampoline) / obj->tramp_size;<br>
+    0 : rtems_rtl_obj_tramp_avail_space (obj) / obj->tramp_size;<br>
 }<br>
<br>
 /**<br>
diff --git a/cpukit/include/rtems/rtl/rtl.h b/cpukit/include/rtems/rtl/rtl.h<br>
index 67d7e96be3..3c74370187 100644<br>
--- a/cpukit/include/rtems/rtl/rtl.h<br>
+++ b/cpukit/include/rtems/rtl/rtl.h<br>
@@ -88,7 +88,7 @@ extern struct r_debug _rtld_debug;<br>
  * Debugger break function. Call when debugging to have it read the _rtld_debug<br>
  * variable.<br>
  */<br>
-extern void _rtld_debug_state (void);<br>
+void _rtld_debug_state (void);<br>
<br>
 /**<br>
  * The type of constructor/destructor function.<br>
diff --git a/cpukit/include/rtems/score/priority.h b/cpukit/include/rtems/score/priority.h<br>
index 54b91a871b..a6c65d3c4c 100644<br>
--- a/cpukit/include/rtems/score/priority.h<br>
+++ b/cpukit/include/rtems/score/priority.h<br>
@@ -24,12 +24,12 @@<br>
 #include <rtems/score/cpu.h><br>
 #include <rtems/score/rbtree.h><br>
<br>
-struct _Scheduler_Control;<br>
-<br>
 #ifdef __cplusplus<br>
 extern "C" {<br>
 #endif<br>
<br>
+struct _Scheduler_Control;<br>
+<br>
 /**<br>
  * @defgroup RTEMSScorePriority Priority Handler<br>
  *<br>
diff --git a/cpukit/include/rtems/score/priorityimpl.h b/cpukit/include/rtems/score/priorityimpl.h<br>
index b33419acdb..3b92d3375a 100644<br>
--- a/cpukit/include/rtems/score/priorityimpl.h<br>
+++ b/cpukit/include/rtems/score/priorityimpl.h<br>
@@ -389,7 +389,7 @@ RTEMS_INLINE_ROUTINE bool _Priority_Less(<br>
   const Priority_Control *the_left;<br>
   const Priority_Node    *the_right;<br>
<br>
-  the_left = left;<br>
+  the_left = (const Priority_Control*) left;<br>
   the_right = RTEMS_CONTAINER_OF( right, Priority_Node, Node.RBTree );<br>
<br>
   return *the_left < the_right->priority;<br>
diff --git a/cpukit/include/rtems/score/scheduleredfimpl.h b/cpukit/include/rtems/score/scheduleredfimpl.h<br>
index f2bec2dfbe..fc8c67c163 100644<br>
--- a/cpukit/include/rtems/score/scheduleredfimpl.h<br>
+++ b/cpukit/include/rtems/score/scheduleredfimpl.h<br>
@@ -100,7 +100,7 @@ RTEMS_INLINE_ROUTINE bool _Scheduler_EDF_Less(<br>
   Priority_Control          prio_left;<br>
   Priority_Control          prio_right;<br>
<br>
-  the_left = left;<br>
+  the_left = (const Priority_Control*) left;<br>
   the_right = RTEMS_CONTAINER_OF( right, Scheduler_EDF_Node, Node );<br>
<br>
   prio_left = *the_left;<br>
@@ -128,7 +128,7 @@ RTEMS_INLINE_ROUTINE bool _Scheduler_EDF_Priority_less_equal(<br>
   Priority_Control          prio_left;<br>
   Priority_Control          prio_right;<br>
<br>
-  the_left = left;<br>
+  the_left = (const Priority_Control*) left;<br>
   the_right = RTEMS_CONTAINER_OF( right, Scheduler_EDF_Node, Node );<br>
<br>
   prio_left = *the_left;<br>
diff --git a/cpukit/include/rtems/score/tls.h b/cpukit/include/rtems/score/tls.h<br>
index 65a49d87be..322be30c7a 100644<br>
--- a/cpukit/include/rtems/score/tls.h<br>
+++ b/cpukit/include/rtems/score/tls.h<br>
@@ -222,7 +222,7 @@ static inline void *_TLS_TCB_at_area_begin_initialize( void *tls_area )<br>
 {<br>
   void *tls_block = (char *) tls_area<br>
     + _TLS_Get_thread_control_block_area_size( (uintptr_t) _TLS_Alignment );<br>
-  TLS_Thread_control_block *tcb = tls_area;<br>
+  TLS_Thread_control_block *tcb = (TLS_Thread_control_block*) tls_area;<br>
   uintptr_t aligned_size = _TLS_Heap_align_up( (uintptr_t) _TLS_Size );<br>
   TLS_Dynamic_thread_vector *dtv = (TLS_Dynamic_thread_vector *)<br>
     ((char *) tls_block + aligned_size);<br>
diff --git a/cpukit/include/rtems/score/watchdogimpl.h b/cpukit/include/rtems/score/watchdogimpl.h<br>
index a52fb1c2cb..ed9d1ef5cd 100644<br>
--- a/cpukit/include/rtems/score/watchdogimpl.h<br>
+++ b/cpukit/include/rtems/score/watchdogimpl.h<br>
@@ -150,7 +150,7 @@ RTEMS_INLINE_ROUTINE Watchdog_State _Watchdog_Get_state(<br>
   const Watchdog_Control *the_watchdog<br>
 )<br>
 {<br>
-  return RB_COLOR( &the_watchdog->Node.RBTree, Node );<br>
+  return (Watchdog_State) RB_COLOR( &the_watchdog->Node.RBTree, Node );<br>
 }<br>
<br>
 /**<br>
-- <br>
2.24.1<br>
<br>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank" rel="noreferrer">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</blockquote></div>