score: Define _Assert() for static analysis runs

The goal is to reduce false positive NULL_RETURNS,
PW.NORETURN_FUNCTION_DOES_RETURN, PW.SET_BUT_NOT_USED,
UNUSED_VALUE, etc. issues produced by Coverity.

Define RTEMS_STATIC_ANALYSIS if a static analysis run by Coverity is
performed.
This commit is contained in:
Sebastian Huber
2021-01-29 07:07:51 +01:00
parent 8f7baef4a6
commit 490e6e8809
2 changed files with 13 additions and 2 deletions

View File

@@ -46,9 +46,9 @@ extern "C" {
/**
* @brief Assertion similar to assert() controlled via RTEMS_DEBUG instead of
* NDEBUG.
* NDEBUG and static analysis runs.
*/
#if defined( RTEMS_DEBUG )
#if defined( RTEMS_DEBUG ) || defined( RTEMS_STATIC_ANALYSIS )
/**
* @brief Macro with method name used in assert output

View File

@@ -748,6 +748,17 @@ extern "C" {
#define RTEMS_SECTION( _section )
#endif
/* Generated from spec:/rtems/basedefs/if/static-analysis */
/**
* @ingroup RTEMSAPIBaseDefs
*
* @brief It is defined if a static analysis run is performed.
*/
#if defined(__COVERITY__)
#define RTEMS_STATIC_ANALYSIS
#endif
/* Generated from spec:/rtems/basedefs/if/static-assert */
/**