mirror of
				https://github.com/FreeRTOS/FreeRTOS-Kernel.git
				synced 2025-11-04 02:32:42 -05:00 
			
		
		
		
	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:
		
							parent
							
								
									45dd83a8e3
								
							
						
					
					
						commit
						2eff037080
					
				
					 1 changed files with 7 additions and 5 deletions
				
			
		
							
								
								
									
										12
									
								
								tasks.c
									
										
									
									
									
								
							
							
						
						
									
										12
									
								
								tasks.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -703,11 +703,13 @@ static void prvYieldCore( BaseType_t xCoreID )
 | 
			
		|||
        {
 | 
			
		||||
            xYieldPendings[ xCoreID ] = pdTRUE;
 | 
			
		||||
        }
 | 
			
		||||
        else
 | 
			
		||||
        {
 | 
			
		||||
            portYIELD_CORE( xCoreID );
 | 
			
		||||
            pxCurrentTCBs[ xCoreID ]->xTaskRunState = taskTASK_YIELDING;
 | 
			
		||||
        }
 | 
			
		||||
        #if ( configNUM_CORES > 1 )
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
                portYIELD_CORE( xCoreID );
 | 
			
		||||
                pxCurrentTCBs[ xCoreID ]->xTaskRunState = taskTASK_YIELDING;
 | 
			
		||||
            }
 | 
			
		||||
        #endif
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue