mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-19 21:11:57 -04:00
Update static stream buffer size check (#693)
* Use volatile size instead of sizeof directly to prevent always true/false warning
This commit is contained in:
parent
aa012e8d82
commit
788f8cfd76
|
@ -436,11 +436,13 @@ static void prvInitialiseNewStreamBuffer( StreamBuffer_t * const pxStreamBuffer,
|
||||||
configASSERT( xBufferSizeBytes > sbBYTES_TO_STORE_MESSAGE_LENGTH );
|
configASSERT( xBufferSizeBytes > sbBYTES_TO_STORE_MESSAGE_LENGTH );
|
||||||
|
|
||||||
#if ( configASSERT_DEFINED == 1 )
|
#if ( configASSERT_DEFINED == 1 )
|
||||||
|
{
|
||||||
/* Sanity check that the size of the structure used to declare a
|
/* Sanity check that the size of the structure used to declare a
|
||||||
* variable of type StaticStreamBuffer_t equals the size of the real
|
* variable of type StaticStreamBuffer_t equals the size of the real
|
||||||
* message buffer structure. */
|
* message buffer structure. */
|
||||||
configASSERT( sizeof( StaticStreamBuffer_t ) == sizeof( StreamBuffer_t ) );
|
volatile size_t xSize = sizeof( StaticStreamBuffer_t );
|
||||||
|
configASSERT( xSize == sizeof( StreamBuffer_t ) );
|
||||||
|
} /*lint !e529 xSize is referenced is configASSERT() is defined. */
|
||||||
#endif /* configASSERT_DEFINED */
|
#endif /* configASSERT_DEFINED */
|
||||||
|
|
||||||
if( ( pucStreamBufferStorageArea != NULL ) && ( pxStaticStreamBuffer != NULL ) )
|
if( ( pucStreamBufferStorageArea != NULL ) && ( pxStaticStreamBuffer != NULL ) )
|
||||||
|
|
Loading…
Reference in a new issue