mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-08 04:02:27 +00:00
Merge branch 'bugfix/assert_ndebug' into 'master'
feat(newlib): add option to disable eval of expression in assert() when NDEBUG set Closes IDFGH-479 and IDFGH-8692 See merge request espressif/esp-idf!32887
This commit is contained in:
@@ -115,6 +115,7 @@ static BaseType_t prvTestWaitCondition( const EventBits_t uxCurrentEventBits,
|
||||
* event group structure. */
|
||||
volatile size_t xSize = sizeof( StaticEventGroup_t );
|
||||
configASSERT( xSize == sizeof( EventGroup_t ) );
|
||||
( void ) xSize; /* Prevent unused variable warning when configASSERT() is not used. */
|
||||
} /*lint !e529 xSize is referenced if configASSERT() is defined. */
|
||||
#endif /* configASSERT_DEFINED */
|
||||
|
||||
|
@@ -455,6 +455,7 @@ static void prvInitialiseNewStreamBuffer( StreamBuffer_t * const pxStreamBuffer,
|
||||
* message buffer structure. */
|
||||
volatile size_t xSize = sizeof( StaticStreamBuffer_t );
|
||||
configASSERT( xSize == sizeof( StreamBuffer_t ) );
|
||||
( void ) xSize; /* Prevent unused variable warning when configASSERT() is not used. */
|
||||
} /*lint !e529 xSize is referenced is configASSERT() is defined. */
|
||||
#endif /* configASSERT_DEFINED */
|
||||
|
||||
@@ -1420,6 +1421,7 @@ static void prvInitialiseNewStreamBuffer( StreamBuffer_t * const pxStreamBuffer,
|
||||
* result in confusion as to what is actually being observed. */
|
||||
const BaseType_t xWriteValue = 0x55;
|
||||
configASSERT( memset( pucBuffer, ( int ) xWriteValue, xBufferSizeBytes ) == pucBuffer );
|
||||
(void)xWriteValue;
|
||||
} /*lint !e529 !e438 xWriteValue is only used if configASSERT() is defined. */
|
||||
#endif
|
||||
|
||||
|
@@ -164,7 +164,8 @@ err:
|
||||
portYIELD_WITHIN_API();
|
||||
}
|
||||
|
||||
BaseType_t xResult;
|
||||
// Return value unused if asserts are disabled
|
||||
BaseType_t __attribute__((unused)) xResult;
|
||||
StaticTask_t * pxTaskBuffer;
|
||||
StackType_t * puxStackBuffer;
|
||||
|
||||
@@ -187,7 +188,8 @@ err:
|
||||
* from another task's context. */
|
||||
configASSERT( eRunning != eTaskGetState( xTaskToDelete ) );
|
||||
|
||||
BaseType_t xResult;
|
||||
// Return value unused if asserts are disabled
|
||||
BaseType_t __attribute__((unused)) xResult;
|
||||
StaticTask_t * pxTaskBuffer;
|
||||
StackType_t * puxStackBuffer;
|
||||
|
||||
@@ -260,7 +262,8 @@ err:
|
||||
|
||||
void vQueueDeleteWithCaps( QueueHandle_t xQueue )
|
||||
{
|
||||
BaseType_t xResult;
|
||||
// Return value unused if asserts are disabled
|
||||
BaseType_t __attribute__((unused)) xResult;
|
||||
StaticQueue_t * pxQueueBuffer;
|
||||
uint8_t * pucQueueStorageBuffer;
|
||||
|
||||
@@ -332,7 +335,8 @@ err:
|
||||
|
||||
void vSemaphoreDeleteWithCaps( SemaphoreHandle_t xSemaphore )
|
||||
{
|
||||
BaseType_t xResult;
|
||||
// Return value unused if asserts are disabled
|
||||
BaseType_t __attribute__((unused)) xResult;
|
||||
StaticSemaphore_t * pxSemaphoreBuffer;
|
||||
|
||||
/* Retrieve the buffer used to create the semaphore before deleting it
|
||||
@@ -404,7 +408,8 @@ err:
|
||||
void vStreamBufferGenericDeleteWithCaps( StreamBufferHandle_t xStreamBuffer,
|
||||
BaseType_t xIsMessageBuffer )
|
||||
{
|
||||
BaseType_t xResult;
|
||||
// Return value unused if asserts are disabled
|
||||
BaseType_t __attribute__((unused)) xResult;
|
||||
StaticStreamBuffer_t * pxStaticStreamBuffer;
|
||||
uint8_t * pucStreamBufferStorageArea;
|
||||
|
||||
|
@@ -59,7 +59,8 @@
|
||||
|
||||
void vEventGroupDeleteWithCaps( EventGroupHandle_t xEventGroup )
|
||||
{
|
||||
BaseType_t xResult;
|
||||
// Return value unused if asserts are disabled
|
||||
BaseType_t __attribute__((unused)) xResult;
|
||||
StaticEventGroup_t * pxEventGroupBuffer;
|
||||
|
||||
/* Retrieve the buffer used to create the event group before deleting it
|
||||
|
Reference in New Issue
Block a user