diff -r e8f354a25ac8 -r 68754c7de906 src/cx/iterator.h --- a/src/cx/iterator.h Thu Nov 07 20:22:56 2024 +0100 +++ b/src/cx/iterator.h Thu Nov 07 22:46:58 2024 +0100 @@ -46,7 +46,7 @@ /** * True iff the iterator points to valid data. */ - __attribute__ ((__nonnull__)) + cx_attr_nonnull bool (*valid)(const void *); /** @@ -54,13 +54,15 @@ * * When valid returns false, the behavior of this function is undefined. */ - __attribute__ ((__nonnull__)) + cx_attr_nonnull + cx_attr_nodiscard void *(*current)(const void *); /** * Original implementation in case the function needs to be wrapped. */ - __attribute__ ((__nonnull__)) + cx_attr_nonnull + cx_attr_nodiscard void *(*current_impl)(const void *); /** @@ -68,7 +70,7 @@ * * When valid returns false, the behavior of this function is undefined. */ - __attribute__ ((__nonnull__)) + cx_attr_nonnull void (*next)(void *); /** * Indicates whether this iterator may remove elements. @@ -228,7 +230,7 @@ * @param elem_count the number of elements in the array * @return an iterator for the specified array */ -__attribute__((__warn_unused_result__)) +cx_attr_nodiscard CxIterator cxIterator( const void *array, size_t elem_size, @@ -258,7 +260,7 @@ * when removing an element * @return an iterator for the specified array */ -__attribute__((__warn_unused_result__)) +cx_attr_nodiscard CxIterator cxMutIterator( void *array, size_t elem_size,