Workaround 'struct member Generic::null never used' cppcheck style warning
authorIvan Maidanski <ivmai@mail.ru>
Thu, 1 Sep 2016 14:00:37 +0000 (17:00 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Thu, 1 Sep 2016 14:00:37 +0000 (17:00 +0300)
* cord/cordbscs.c (CORD_from_fn): Check that 'null' field of the
allocated Function object is zero.

cord/cordbscs.c

index efe75b5..d6c33ee 100644 (file)
@@ -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;