bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

regex-quote: Improve GCC 11 allocation-deallocation checking


From: Bruno Haible
Subject: regex-quote: Improve GCC 11 allocation-deallocation checking
Date: Sat, 07 Aug 2021 22:03:33 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-210-generic; KDE/5.18.0; x86_64; ; )

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'.

diff --git a/lib/regex-quote.h b/lib/regex-quote.h
index 470393e..9e8e694 100644
--- a/lib/regex-quote.h
+++ b/lib/regex-quote.h
@@ -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 */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]