From 392c16a063455fbc2b634529b48407e1976151ac Mon Sep 17 00:00:00 2001 From: Bruno Haible <bruno@clisp.org> Date: Sat, 7 Aug 2021 22:10:29 +0200 Subject: [PATCH] striconveh: Improve GCC 11 allocation-deallocation checking. * lib/striconveh.h: Include <stdlib.h> instead of <stddef.h>. (str_cd_iconveh, str_iconveh): Declare that deallocation must happen through 'free'. --- ChangeLog | 7 +++++++ lib/striconveh.h | 8 +++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3d25b03018..7b4a25e594 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2021-08-07 Bruno Haible <bruno@clisp.org> + + striconveh: Improve GCC 11 allocation-deallocation checking. + * lib/striconveh.h: Include <stdlib.h> instead of <stddef.h>. + (str_cd_iconveh, str_iconveh): Declare that deallocation must happen + through 'free'. + 2021-08-07 Bruno Haible <bruno@clisp.org> striconv: Improve GCC 11 allocation-deallocation checking. diff --git a/lib/striconveh.h b/lib/striconveh.h index bd8e0fea05..60c632928f 100644 --- a/lib/striconveh.h +++ b/lib/striconveh.h @@ -18,7 +18,7 @@ #ifndef _STRICONVEH_H #define _STRICONVEH_H -#include <stddef.h> +#include <stdlib.h> #if HAVE_ICONV #include <iconv.h> #endif @@ -95,7 +95,8 @@ extern int extern char * str_cd_iconveh (const char *src, const iconveh_t *cd, - enum iconv_ilseq_handler handler); + enum iconv_ilseq_handler handler) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE; #endif @@ -129,7 +130,8 @@ extern int extern char * str_iconveh (const char *src, const char *from_codeset, const char *to_codeset, - enum iconv_ilseq_handler handler); + enum iconv_ilseq_handler handler) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE; #ifdef __cplusplus -- 2.39.5