summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2021-08-07 15:01:33 +0200
committerBruno Haible <bruno@clisp.org>2021-08-07 15:01:33 +0200
commitba20910ef986e92f457c9166304100d73c4b416a (patch)
tree2573e619925e55cadda00f85cd281a2cc70c9dd3 /lib
parent2533aa89db0f7d6e4ece0d5246ddad63c8be628a (diff)
downloadgnulib-ba20910ef986e92f457c9166304100d73c4b416a.tar.gz
dfa: Improve GCC 11 allocation-deallocation checking.
* lib/dfa.h (dfamust): Declare that deallocation must happen through dfamustfree.
Diffstat (limited to 'lib')
-rw-r--r--lib/dfa.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/dfa.h b/lib/dfa.h
index 28f9f6336e..edc39dc49c 100644
--- a/lib/dfa.h
+++ b/lib/dfa.h
@@ -88,13 +88,16 @@ extern void dfacopysyntax (struct dfa *, struct dfa const *);
/* Parse the given string of given length into the given struct dfa. */
extern void dfaparse (char const *, ptrdiff_t, struct dfa *);
-/* Allocate and return a struct dfamust from a struct dfa that was
- initialized by dfaparse and not yet given to dfacomp. */
-extern struct dfamust *dfamust (struct dfa const *);
+struct dfamust;
/* Free the storage held by the components of a struct dfamust. */
extern void dfamustfree (struct dfamust *);
+/* Allocate and return a struct dfamust from a struct dfa that was
+ initialized by dfaparse and not yet given to dfacomp. */
+extern struct dfamust *dfamust (struct dfa const *)
+ _GL_ATTRIBUTE_DEALLOC (dfamustfree, 1);
+
/* Compile the given string of the given length into the given struct dfa.
The last argument says whether to build a searching or an exact matcher.
A null first argument means the struct dfa has already been