]> granicus.if.org Git - gc/commitdiff
Eliminate 'non-null arg compared to null' warning in toggleref_add (GCC)
authorIvan Maidanski <ivmai@mail.ru>
Wed, 27 Sep 2017 08:22:18 +0000 (11:22 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Thu, 28 Sep 2017 21:57:57 +0000 (00:57 +0300)
(fix commit 86991cb)

* finalize.c [!GC_TOGGLE_REFS_NOT_NEEDED] (GC_toggleref_add): Use
NONNULL_ARG_NOT_NULL to check pointer argument marked as non-null (in
the function declaration) is actually non-null.

finalize.c

index bd297a9cb492ea37cdfe4c6c41bcbc9a2d89cb99..bb607e07ef9efb1f380fbb85815d42bc681fa554 100644 (file)
@@ -426,7 +426,7 @@ GC_API int GC_CALL GC_unregister_disappearing_link(void * * link)
     int res = GC_SUCCESS;
     DCL_LOCK_STATE;
 
-    GC_ASSERT(obj != NULL);
+    GC_ASSERT(NONNULL_ARG_NOT_NULL(obj));
     LOCK();
     if (GC_toggleref_callback != 0) {
       if (!ensure_toggleref_capacity(1)) {