From ae2745385e6f56a6f486b4846a4b64bb40af128d Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 7 Aug 2021 19:29:57 +0200 Subject: [PATCH] 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'. --- ChangeLog | 7 +++++++ lib/di-set.h | 10 ++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 29f41d707b..472c70a9d8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2021-08-07 Bruno Haible + + 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 [x]concat-filename: Improve GCC 11 allocation-deallocation checking. diff --git a/lib/di-set.h b/lib/di-set.h index ae380d307d..30c81ed3bf 100644 --- a/lib/di-set.h +++ b/lib/di-set.h @@ -21,9 +21,15 @@ # include -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)); -- 2.39.5