]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
coverity: Add some documentation for the modelling file
authorAndreas Schneider <asn@samba.org>
Thu, 2 Feb 2023 16:27:01 +0000 (17:27 +0100)
committerAnoop C S <anoopcs@samba.org>
Tue, 5 Aug 2025 06:07:37 +0000 (06:07 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Shwetha K Acharya <Shwetha.K.Acharya@ibm.com>
coverity/coverity_assert_model.c

index ba5c17d0a5885ee91810e3e4311c2925f7e86c10..d1eb26519c4dfa7c7adc39caaae83729e7a3f05d 100644 (file)
@@ -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,