From 3fea666ef34f90b2c04095274c449b0b7978d756 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Thu, 1 Sep 2016 17:00:37 +0300 Subject: [PATCH] Workaround 'struct member Generic::null never used' cppcheck style warning * cord/cordbscs.c (CORD_from_fn): Check that 'null' field of the allocated Function object is zero. --- cord/cordbscs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/cord/cordbscs.c b/cord/cordbscs.c index efe75b54..d6c33ee9 100644 --- a/cord/cordbscs.c +++ b/cord/cordbscs.c @@ -306,6 +306,7 @@ CORD CORD_from_fn(CORD_fn fn, void * client_data, size_t len) result = GC_NEW(struct Function); if (result == 0) OUT_OF_MEMORY; + if (result->null != 0) ABORT("error"); /* make 'null' field used */ result->header = FN_HDR; /* depth is already 0 */ result->len = len; -- 2.40.0