]> Savannah Git Hosting - gnulib.git/commitdiff
di-set: Improve GCC 11 allocation-deallocation checking.
authorBruno Haible <bruno@clisp.org>
Sat, 7 Aug 2021 17:29:57 +0000 (19:29 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 7 Aug 2021 17:29:57 +0000 (19:29 +0200)
* lib/di-set.h (di_set_free): Move declaration up.
(di_set_alloc): Declare that deallocation must happen through
'di_set_free'.

ChangeLog
lib/di-set.h

index 29f41d707b343fe9112c785622a9b42595771691..472c70a9d86f9740b59e10c924b541bf5c2bd950 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2021-08-07  Bruno Haible  <bruno@clisp.org>
+
+       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'.
+
 2021-08-07  Bruno Haible  <bruno@clisp.org>
 
        [x]concat-filename: Improve GCC 11 allocation-deallocation checking.
index ae380d307d73f596e3bf9a244c3dfecb9d00a9ff..30c81ed3bfe71dbcb36c182e8e3d6d0de4eb473f 100644 (file)
 
 # 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));