diff options
author | Bruno Haible <bruno@clisp.org> | 2021-08-07 22:02:37 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2021-08-07 22:02:37 +0200 |
commit | 72ec85aef0ad111d5a0c73e38caef3ed01516fb0 (patch) | |
tree | e0cfefd26fb365a7d763610f2ee7eed0d05138e1 /lib/regex-quote.h | |
parent | fe15063a016258d81bf3cec3754ee41a1d317a3b (diff) | |
download | gnulib-72ec85aef0ad111d5a0c73e38caef3ed01516fb0.tar.gz |
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'.
Diffstat (limited to 'lib/regex-quote.h')
-rw-r--r-- | lib/regex-quote.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/regex-quote.h b/lib/regex-quote.h index 470393eb8f..9e8e694375 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 */ |