From 03e4303ff8d76325036f4e603687a6d3dc36001b Mon Sep 17 00:00:00 2001 From: Arto Bendiken Date: Wed, 15 Oct 2014 13:59:04 +0000 Subject: [PATCH] Imported a model file for Coverity Scan to reduce false positives. In general, any function declared with the 'ecl_attr_noreturn' attribute might need to be defined to call __coverity_panic__() here. See: https://scan.coverity.com/tune --- src/c/coverity/model.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/c/coverity/model.c diff --git a/src/c/coverity/model.c b/src/c/coverity/model.c new file mode 100644 index 000000000..57257938c --- /dev/null +++ b/src/c/coverity/model.c @@ -0,0 +1,33 @@ +/* This is free and unencumbered software released into the public domain. */ + +/** + * Coverity Scan model for ECL. + * + * This is a modeling file for the Coverity Scan static analysis service. + * Modeling helps to avoid false positives. Some rules for model files: + * + * - A model file cannot import any header files. + * - Therefore only built-in standard language symbols are available; + * for example, `char`, `int`, and `void` are defined, `NULL` isn't. + * - Modeling doesn't require genuine definitions for structs and typedefs. + * Typedefs that expand to rudimentary structs will suffice. + * - Uninitialized local pointers are not errors, but rather signify that + * a variable could either be `NULL` or point at some data. + * + * Note that Coverity Scan doesn't automatically pick up changes to this + * file. New versions of the model file must be uploaded by an admin at: + * https://scan.coverity.com/projects/3235?tab=analysis_settings + * + * @author Arto Bendiken + * @see https://scan.coverity.com/tune + */ + +#define NULL ((void*)0) + +typedef void* cl_object; +typedef int cl_narg; + +void +FEwrong_type_nth_arg(cl_object function, cl_narg narg, cl_object value, cl_object type) { + __coverity_panic__(); +}