This is indeed used in some places (only inside lw_assert()s, so it is only needed in debug build).

src/atomic_list.c:    lw_assert(lw_atomic32_inc_with_ret(lw_cast_no_const(&list->refcnt)) > 0);
src/atomic_list.c:    lw_assert(((int)lw_atomic32_dec_with_ret(lw_cast_no_const(&list->refcnt))) >= 0);
src/atomic_list.c:    lw_assert(lw_atomic32_inc_with_ret(lw_cast_no_const(&list->refcnt)) > 0);
src/atomic_list.c:    lw_assert(((int)lw_atomic32_dec_with_ret(lw_cast_no_const(&list->refcnt))) >= 0);