Update prvYieldCore() compile warning for single core targets (#505)

When configNUM_CORES is 1, prvYieldCore() generates an array subscript
outofbound error (-Warray-bounds) when compiled with GCC with space
optimization enabled (-Os).

This commit updates the code flow in prvYieldCore() to compile out
the part where yield is needed on the other core which is unnecessary
for single-core targets.
This commit is contained in:
Sudeep Mohanty 2022-06-22 06:33:44 +02:00 committed by GitHub
parent 45dd83a8e3
commit 2eff037080
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -703,11 +703,13 @@ static void prvYieldCore( BaseType_t xCoreID )
{ {
xYieldPendings[ xCoreID ] = pdTRUE; xYieldPendings[ xCoreID ] = pdTRUE;
} }
#if ( configNUM_CORES > 1 )
else else
{ {
portYIELD_CORE( xCoreID ); portYIELD_CORE( xCoreID );
pxCurrentTCBs[ xCoreID ]->xTaskRunState = taskTASK_YIELDING; pxCurrentTCBs[ xCoreID ]->xTaskRunState = taskTASK_YIELDING;
} }
#endif
} }
} }