From: Bruno Haible Date: Sat, 7 Aug 2021 20:02:37 +0000 (+0200) Subject: regex-quote: Improve GCC 11 allocation-deallocation checking. X-Git-Tag: v1.0~2693 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=72ec85aef0ad111d5a0c73e38caef3ed01516fb0;p=gnulib.git regex-quote: Improve GCC 11 allocation-deallocation checking. * lib/regex-quote.h: Include instead of . (regex_quote): Declare that deallocation must happen through 'free'. --- diff --git a/ChangeLog b/ChangeLog index 8ce06c44db..ac96080531 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2021-08-07 Bruno Haible + + regex-quote: Improve GCC 11 allocation-deallocation checking. + * lib/regex-quote.h: Include instead of . + (regex_quote): Declare that deallocation must happen through 'free'. + 2021-08-07 Bruno Haible readline: Improve GCC 11 allocation-deallocation checking. 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 #include +#include /* 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 */