@@ -82,6 +82,7 @@ static void wait_for_guard_obj(guard_t* g)
8282 do {
8383 auto result = xSemaphoreGive (s_static_init_mutex);
8484 assert (result);
85+ static_cast <void >(result);
8586 /* Task may be preempted here, but this isn't a problem,
8687 * as the semaphore will be given exactly the s_static_init_waiting_count
8788 * number of times; eventually the current task will execute next statement,
@@ -140,6 +141,7 @@ extern "C" int __cxa_guard_acquire(__guard* pg)
140141 */
141142 auto result = xSemaphoreTake (s_static_init_mutex, portMAX_DELAY);
142143 assert (result);
144+ static_cast <void >(result);
143145 if (g->pending ) {
144146 /* Another task is doing initialization at the moment; wait until it calls
145147 * __cxa_guard_release or __cxa_guard_abort
@@ -168,6 +170,7 @@ extern "C" int __cxa_guard_acquire(__guard* pg)
168170 if (scheduler_started) {
169171 auto result = xSemaphoreGive (s_static_init_mutex);
170172 assert (result);
173+ static_cast <void >(result);
171174 }
172175 return ret;
173176}
@@ -179,6 +182,7 @@ extern "C" void __cxa_guard_release(__guard* pg)
179182 if (scheduler_started) {
180183 auto result = xSemaphoreTake (s_static_init_mutex, portMAX_DELAY);
181184 assert (result);
185+ static_cast <void >(result);
182186 }
183187 assert (g->pending && " tried to release a guard which wasn't acquired" );
184188 g->pending = 0 ;
@@ -189,6 +193,7 @@ extern "C" void __cxa_guard_release(__guard* pg)
189193 signal_waiting_tasks ();
190194 auto result = xSemaphoreGive (s_static_init_mutex);
191195 assert (result);
196+ static_cast <void >(result);
192197 }
193198}
194199
@@ -199,6 +204,7 @@ extern "C" void __cxa_guard_abort(__guard* pg)
199204 if (scheduler_started) {
200205 auto result = xSemaphoreTake (s_static_init_mutex, portMAX_DELAY);
201206 assert (result);
207+ static_cast <void >(result);
202208 }
203209 assert (!g->ready && " tried to abort a guard which is ready" );
204210 assert (g->pending && " tried to release a guard which is not acquired" );
@@ -208,6 +214,7 @@ extern "C" void __cxa_guard_abort(__guard* pg)
208214 signal_waiting_tasks ();
209215 auto result = xSemaphoreGive (s_static_init_mutex);
210216 assert (result);
217+ static_cast <void >(result);
211218 }
212219}
213220
0 commit comments