"--enable=all"
"--suppress=missingIncludeSystem"
"--suppress=nullPointerRedundantCheck"
- (concat "--suppressions-list=" (expand-file-name
- (concat directory-of-current-dir-locals-file "util/suppressions.txt")))
+ "--suppress=preprocessorErrorDirective"
+ "--suppress=unknownMacro"
+ "--suppress=unmatchedSuppression"
(concat "-include=" (expand-file-name
(concat directory-of-current-dir-locals-file "config.h")))
)
typedef void(fatalcallback_t)(void);
-#ifndef CPPCHECK
ISC_NORETURN void
fatal(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
-#else /* CPPCHECK */
-#define fatal(...) exit(1)
-#endif
void
setfatalcallback(fatalcallback_t *callback);
* Fix color violations.
*/
if (IS_BLACK(item)) {
- /* cppcheck-suppress nullPointerRedundantCheck symbolName=item
- */
parent = PARENT(item);
while (child != *rootp && IS_BLACK(child)) {
INSIST(sibling != NULL);
- /* cppcheck-suppress nullPointerRedundantCheck
- * symbolName=sibling */
if (IS_BLACK(LEFT(sibling)) &&
IS_BLACK(RIGHT(sibling))) {
MAKE_RED(sibling);
INSIST(sibling != NULL);
- /* cppcheck-suppress nullPointerRedundantCheck
- * symbolName=sibling */
if (IS_BLACK(LEFT(sibling)) &&
IS_BLACK(RIGHT(sibling))) {
MAKE_RED(sibling);
}
}
- /* cppcheck-suppress nullPointerRedundantCheck symbolName=node */
if ((DOWN(node) != NULL) && (!IS_ROOT(DOWN(node)))) {
return (false);
}
return (true);
}
- /* cppcheck-suppress nullPointerRedundantCheck symbolName=node */
if (!check_black_distance_helper(LEFT(node), &dl)) {
return (false);
}
- /* cppcheck-suppress nullPointerRedundantCheck symbolName=node */
if (!check_black_distance_helper(RIGHT(node), &dr)) {
return (false);
}
- /* cppcheck-suppress nullPointerRedundantCheck symbolName=node */
if (!check_black_distance_helper(DOWN(node), &dd)) {
return (false);
}
if (root != NULL) {
printnodename(root, true, f);
- /*
- * Don't use IS_RED(root) as it tests for 'root != NULL'
- * and cppcheck produces false positives.
- */
fprintf(f, " (%s, %s", direction,
COLOR(root) == RED ? "RED" : "BLACK");
depth++;
- /*
- * Don't use IS_RED(root) as it tests for 'root != NULL'
- * and cppcheck produces false positives.
- */
if (COLOR(root) == RED && IS_RED(LEFT(root))) {
fprintf(f, "** Red/Red color violation on left\n");
}
print_text_helper(LEFT(root), root, depth, "left", data_printer,
f);
- /*
- * Don't use IS_RED(root) as cppcheck produces false positives.
- */
if (COLOR(root) == RED && IS_RED(RIGHT(root))) {
fprintf(f, "** Red/Red color violation on right\n");
}
#include <isc/netdb.h>
#include <isc/once.h>
-/*
- * Redefine CHECK here so cppcheck "sees" the define.
- */
-#ifndef CHECK
-#define CHECK(op) \
- do { \
- result = (op); \
- if (result != ISC_R_SUCCESS) \
- goto cleanup; \
- } while (0)
-#endif /* ifndef CHECK */
-
#define RRTYPE_WKS_ATTRIBUTES (0)
static isc_mutex_t wks_lock;
* XXX Can TCP transfers be forwarded? How would that
* work?
*/
- /* cppcheck-suppress uninitStructMember
- * symbolName=tsig.originalid */
id = htons(tsig.originalid);
memmove(&header[0], &id, 2);
}
#else /* _MSC_VER */
#define isc_refcount_increment0(target) \
({ \
- /* cppcheck-suppress shadowVariable */ \
uint_fast32_t __v; \
__v = atomic_fetch_add_relaxed(target, 1); \
INSIST(__v < UINT32_MAX); \
#else /* _MSC_VER */
#define isc_refcount_increment(target) \
({ \
- /* cppcheck-suppress shadowVariable */ \
uint_fast32_t __v; \
__v = atomic_fetch_add_relaxed(target, 1); \
INSIST(__v > 0 && __v < UINT32_MAX); \
#else /* _MSC_VER */
#define isc_refcount_decrement(target) \
({ \
- /* cppcheck-suppress shadowVariable */ \
uint_fast32_t __v; \
__v = atomic_fetch_sub_acq_rel(target, 1); \
INSIST(__v > 0); \
(((a) == (b)) ? (void)0 : (_assert_int_equal(a, b, f, l), abort()))
#define _assert_int_not_equal(a, b, f, l) \
(((a) != (b)) ? (void)0 : (_assert_int_not_equal(a, b, f, l), abort()))
-#else /* UNIT_TESTING */
-
-#ifndef CPPCHECK
+#else /* UNIT_TESTING */
/*
* Assertions
/*% Invariant Assertion */
#define INVARIANT(e) ISC_INVARIANT(e)
-#else /* CPPCHECK */
-
-/*% Require Assertion */
-#define REQUIRE(e) \
- if (!(e)) \
- abort()
-/*% Ensure Assertion */
-#define ENSURE(e) \
- if (!(e)) \
- abort()
-/*% Insist Assertion */
-#define INSIST(e) \
- if (!(e)) \
- abort()
-/*% Invariant Assertion */
-#define INVARIANT(e) \
- if (!(e)) \
- abort()
-
-#endif /* CPPCHECK */
-
#endif /* UNIT_TESTING */
/*
#else /* UNIT_TESTING */
-#ifndef CPPCHECK
/*% Runtime Check */
#define RUNTIME_CHECK(cond) ISC_ERROR_RUNTIMECHECK(cond)
-#else /* ifndef CPPCHECK */
-#define RUNTIME_CHECK(e) \
- if (!(e)) \
- abort()
-#endif /* ifndef CPPCHECK */
#endif /* UNIT_TESTING */
for (dacl = ISC_LIST_HEAD(ctx->named_acl_cache); dacl != NULL;
dacl = ISC_LIST_NEXT(dacl, nextincache))
{
- /* cppcheck-suppress nullPointerRedundantCheck symbolName=dacl
- */
if (strcasecmp(aclname, dacl->name) == 0) {
if (ISC_MAGIC_VALID(dacl, LOOP_MAGIC)) {
cfg_obj_log(nameobj, lctx, ISC_LOG_ERROR,
if ((addrlen % 8) != 0) {
uint8_t bits = ~0U << (8 - (addrlen % 8));
- /* cppcheck-suppress objectIndex */
bits &= paddr[addrbytes - 1];
- /* cppcheck-suppress objectIndex */
if (bits != paddr[addrbytes - 1]) {
return (DNS_R_OPTERR);
}
+++ /dev/null
-unmatchedSuppression:*
-preprocessorErrorDirective:*
-unknownMacro:*
-nullPointerRedundantCheck:*