From bcbd1f9bed885f7c33d530197306205329aed851 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Fri, 3 Feb 2023 11:30:34 +0100 Subject: [PATCH] coverity: Update README.md Signed-off-by: Andreas Schneider Reviewed-by: Anoop C S Reviewed-by: Shwetha K Acharya --- coverity/README.md | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/coverity/README.md b/coverity/README.md index 84795d9fe10..31f1e4e4d61 100644 --- a/coverity/README.md +++ b/coverity/README.md @@ -1,6 +1,27 @@ -coverity_assert_model.c: +# Coverity Scan Modelling File -This file is a Coverity Modeling file for which currently adds the needed models -for using the cmocka unit test framework. The assert functions could create -false positives, to avoid that you can load this modeling file in the Coverity -web interface. If needed add models for torture_ and talloc_ macros. +The `coverity_assert_model.c` is a file for +(Coverity Models)[https://scan.coverity.com/models]. You can find the +documentation for it +(here)[https://documentation.blackduck.com/bundle/coverity-docs/page/customizing_coverity/topics/models_primitives/c_models_primitives.html] + +- 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. + +## Testing the coverity_assert_model.c + +Whenever you modify the `coverity_assert_model.c` please run: + +```sh +make -C coverity +``` + +This will check if the file compiles with gcc. -- 2.47.2