2021-08-07  Bruno Haible  <[email protected]>

        di-set: Improve GCC 11 allocation-deallocation checking.
        * lib/di-set.h (di_set_free): Move declaration up.
        (di_set_alloc): Declare that deallocation must happen through
        'di_set_free'.

diff --git a/lib/di-set.h b/lib/di-set.h
index ae380d3..30c81ed 100644
--- a/lib/di-set.h
+++ b/lib/di-set.h
@@ -21,9 +21,15 @@
 
 # include <sys/types.h>
 
-struct di_set *di_set_alloc (void);
-int di_set_insert (struct di_set *, dev_t, ino_t) _GL_ATTRIBUTE_NONNULL ((1));
+struct di_set;
+
 void di_set_free (struct di_set *) _GL_ATTRIBUTE_NONNULL ((1));
+
+struct di_set *di_set_alloc (void)
+  _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC (di_set_free, 1);
+
+int di_set_insert (struct di_set *, dev_t, ino_t) _GL_ATTRIBUTE_NONNULL ((1));
+
 int di_set_lookup (struct di_set *dis, dev_t dev, ino_t ino)
   _GL_ATTRIBUTE_NONNULL ((1));
 


Reply via email to