bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* regex-quote: Improve GCC 11 allocation-deallocation checking
@ 2021-08-07 20:03 Bruno Haible
  0 siblings, 0 replies; only message in thread
From: Bruno Haible @ 2021-08-07 20:03 UTC (permalink / raw)
  To: bug-gnulib

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 */



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-07 20:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-07 20:03 regex-quote: Improve GCC 11 allocation-deallocation checking Bruno Haible

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).