diff options
author | Bruno Haible <bruno@clisp.org> | 2021-08-07 19:13:56 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2021-08-07 19:13:56 +0200 |
commit | 0e96b118662b70ffd89cb58f3f2857cecf3d9038 (patch) | |
tree | 7e6d7ee90694cbb959c0fc60f58bc96fa2a4a560 /lib | |
parent | a8b11d9c7ad1633ed9a1af1beae1ae718ddd199e (diff) | |
download | gnulib-0e96b118662b70ffd89cb58f3f2857cecf3d9038.tar.gz |
bitsetv: Improve GCC 11 allocation-deallocation checking.
* lib/bitsetv.h (bitsetv_free): Move declaration up.
(bitsetv_alloc, bitsetv_create): Declare that deallocation must happen
through 'bitsetv_free'.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bitsetv.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/bitsetv.h b/lib/bitsetv.h index 72bf2779f2..2ab9b80863 100644 --- a/lib/bitsetv.h +++ b/lib/bitsetv.h @@ -25,16 +25,18 @@ typedef bitset * bitsetv; +/* Free vector of bitsets. Do nothing if NULL. */ +void bitsetv_free (bitsetv); + /* Create a vector of N_VECS bitsets, each of N_BITS, and of type TYPE. */ -bitsetv bitsetv_alloc (bitset_bindex, bitset_bindex, enum bitset_type); +bitsetv bitsetv_alloc (bitset_bindex, bitset_bindex, enum bitset_type) + _GL_ATTRIBUTE_DEALLOC (bitsetv_free, 1); /* Create a vector of N_VECS bitsets, each of N_BITS, and with attribute hints specified by ATTR. */ -bitsetv bitsetv_create (bitset_bindex, bitset_bindex, unsigned); - -/* Free vector of bitsets. Do nothing if NULL. */ -void bitsetv_free (bitsetv); +bitsetv bitsetv_create (bitset_bindex, bitset_bindex, unsigned) + _GL_ATTRIBUTE_DEALLOC (bitsetv_free, 1); /* Zero vector of bitsets. */ void bitsetv_zero (bitsetv); |