]> Savannah Git Hosting - gnulib.git/commitdiff
regex-quote: Improve GCC 11 allocation-deallocation checking.
authorBruno Haible <bruno@clisp.org>
Sat, 7 Aug 2021 20:02:37 +0000 (22:02 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 7 Aug 2021 20:02:37 +0000 (22:02 +0200)
* lib/regex-quote.h: Include <stdlib.h> instead of <stddef.h>.
(regex_quote): Declare that deallocation must happen through 'free'.

ChangeLog
lib/regex-quote.h

index 8ce06c44db867e4defeee7ef34ab96037cc5a0ff..ac96080531f2394670abc6d88e369c24304cef34 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2021-08-07  Bruno Haible  <bruno@clisp.org>
+
+       regex-quote: Improve GCC 11 allocation-deallocation checking.
+       * lib/regex-quote.h: Include <stdlib.h> instead of <stddef.h>.
+       (regex_quote): Declare that deallocation must happen through 'free'.
+
 2021-08-07  Bruno Haible  <bruno@clisp.org>
 
        readline: Improve GCC 11 allocation-deallocation checking.
index 470393eb8fd508be4886f19577dd0e39178fa89b..9e8e6943753cca05bf257181185ee6453c79e9b9 100644 (file)
@@ -18,8 +18,8 @@
 #ifndef _REGEX_QUOTE_H
 #define _REGEX_QUOTE_H
 
-#include <stddef.h>
 #include <stdbool.h>
+#include <stdlib.h>
 
 
 /* Specifies a quotation task for converting a fixed string to a regular
@@ -82,7 +82,9 @@ extern char *
 
 /* Returns the freshly allocated quoted string.  */
 extern char *
-       regex_quote (const char *string, const struct regex_quote_spec *spec);
+       regex_quote (const char *string, const struct regex_quote_spec *spec)
+       _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
+       _GL_ATTRIBUTE_RETURNS_NONNULL;
 
 
 #endif /* _REGEX_QUOTE_H */