<div dir="auto"><div>This only impacts one file and the change is precise so the short log should be more specific.<br><br>Otherwise ok. I hope this makes it happy.</div><div dir="auto"><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On Sat, Jan 28, 2023, 3:59 AM Sebastian Huber <<a href="mailto:sebastian.huber@embedded-brains.de">sebastian.huber@embedded-brains.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Add an assert to _Thread_Initialize_scheduler_and_wait_nodes() which may<br>
help a static analyzer. Use a do/while loop since we have at least one<br>
scheduler.<br>
<br>
Update #4832.<br>
---<br>
cpukit/score/src/threadinitialize.c | 7 +++++--<br>
1 file changed, 5 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/cpukit/score/src/threadinitialize.c b/cpukit/score/src/threadinitialize.c<br>
index 9b37206c6d..0d382853fd 100644<br>
--- a/cpukit/score/src/threadinitialize.c<br>
+++ b/cpukit/score/src/threadinitialize.c<br>
@@ -139,7 +139,10 @@ static void _Thread_Initialize_scheduler_and_wait_nodes(<br>
* The application configuration ensures that we have at least one scheduler<br>
* configured.<br>
*/<br>
- while ( scheduler_index < _Scheduler_Count ) {<br>
+<br>
+ _Assert ( _Scheduler_Count >= 1 );<br>
+<br>
+ do {<br>
Priority_Control priority;<br>
<br>
if ( scheduler == config->scheduler ) {<br>
@@ -172,7 +175,7 @@ static void _Thread_Initialize_scheduler_and_wait_nodes(<br>
( (uintptr_t) scheduler_node + _Scheduler_Node_size );<br>
++scheduler;<br>
++scheduler_index;<br>
- }<br>
+ } while ( scheduler_index < _Scheduler_Count );<br>
<br>
/*<br>
* The thread is initialized to use exactly one scheduler node which is<br>
-- <br>
2.35.3<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></div></div>