From 97fa6f9ffb8d8781b7d8c09a45b1df8024c771e6 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 2 Feb 2023 17:27:01 +0100 Subject: [PATCH] coverity: Add some documentation for the modelling file Signed-off-by: Andreas Schneider Reviewed-by: Anoop C S Reviewed-by: Shwetha K Acharya --- coverity/coverity_assert_model.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/coverity/coverity_assert_model.c b/coverity/coverity_assert_model.c index ba5c17d0a58..d1eb26519c4 100644 --- a/coverity/coverity_assert_model.c +++ b/coverity/coverity_assert_model.c @@ -1,4 +1,26 @@ +/* + * Modelling file for Coverity Scan + * + * This is a modeling file for Coverity Scan. Modeling helps to avoid false + * positives. + * + * - A model file can't import any header files. + * - Therefore only some built-in primitives like int, char and void are + * available but not NULL etc. + * - Modeling doesn't need full structs and typedefs. Rudimentary structs + * and similar types are sufficient. + * - An uninitialized local pointer is not an error. It signifies that the + * variable could be either NULL or have some data. + * + * Coverity Scan doesn't pick up modifications automatically. The model file + * must be uploaded by an admin. + * + * See also https://scan.coverity.com/models + */ + #define LargestIntegralType unsigned long long +#define NULL (void *)0 +/* size_t is already defined by Coverity */ void _assert_true(const LargestIntegralType result, const char* const expression, -- 2.47.2