]> Savannah Git Hosting - gnulib.git/commitdiff
dfa: Improve GCC 11 allocation-deallocation checking.
authorBruno Haible <bruno@clisp.org>
Sat, 7 Aug 2021 13:01:33 +0000 (15:01 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 7 Aug 2021 13:01:33 +0000 (15:01 +0200)
* lib/dfa.h (dfamust): Declare that deallocation must happen through
dfamustfree.

ChangeLog
lib/dfa.h

index e8a1f53fb5ad104d1eabe6e768206212e8f2714a..be764cb5105fabce987d6a6b78078df741cbd180 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2021-08-07  Bruno Haible  <bruno@clisp.org>
+
+       dfa: Improve GCC 11 allocation-deallocation checking.
+       * lib/dfa.h (dfamust): Declare that deallocation must happen through
+       dfamustfree.
+
 2021-08-06  Paul Eggert  <eggert@cs.ucla.edu>
 
        glob: merge from glibc
index 28f9f6336e3d4a39d1795100bc515a7b22b99735..edc39dc49cae667542345641a1676b19fa536338 100644 (file)
--- 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