[PATCH] score: Define _Assert() for Coverity

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Jan 29 06:11:26 UTC 2021


The goal is to reduce false positive NULL_RETURNS,
PW.NORETURN_FUNCTION_DOES_RETURN, PW.SET_BUT_NOT_USED,
UNUSED_VALUE, etc. issues.
---
 cpukit/include/rtems/score/assert.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/cpukit/include/rtems/score/assert.h b/cpukit/include/rtems/score/assert.h
index 2bf1703f19..6c8916f2fc 100644
--- a/cpukit/include/rtems/score/assert.h
+++ b/cpukit/include/rtems/score/assert.h
@@ -45,10 +45,10 @@ extern "C" {
 #endif /* __cplusplus */
 
 /**
- * @brief Assertion similar to assert() controlled via RTEMS_DEBUG instead of
- * NDEBUG.
+ * @brief Assertion similar to assert() controlled via RTEMS_DEBUG or Coverity
+ *   instead of NDEBUG.
  */
-#if defined( RTEMS_DEBUG )
+#if defined( RTEMS_DEBUG ) || defined( __COVERITY__ )
 
   /**
    * @brief Macro with method name used in assert output
-- 
2.26.2



More information about the devel mailing list