From ccecca2b4b943513b8fb514437485ec95f97fb93 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 7 Aug 2021 22:04:55 +0200 Subject: [PATCH] relocatable-lib-lgpl: Improve GCC 11 allocation-deallocation checking. * lib/relocatable.h: Include . (compute_curr_prefix): Declare that deallocation must happen through 'free'. --- ChangeLog | 7 +++++++ lib/relocatable.h | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ac96080531..89e3f5551d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2021-08-07 Bruno Haible + + relocatable-lib-lgpl: Improve GCC 11 allocation-deallocation checking. + * lib/relocatable.h: Include . + (compute_curr_prefix): Declare that deallocation must happen through + 'free'. + 2021-08-07 Bruno Haible regex-quote: Improve GCC 11 allocation-deallocation checking. diff --git a/lib/relocatable.h b/lib/relocatable.h index 25a0b41ae4..2ffb75e99c 100644 --- a/lib/relocatable.h +++ b/lib/relocatable.h @@ -18,6 +18,8 @@ #ifndef _RELOCATABLE_H #define _RELOCATABLE_H +#include + #ifdef __cplusplus extern "C" { #endif @@ -83,7 +85,8 @@ extern const char * relocate2 (const char *pathname, char **allocatedp); Returns it, freshly allocated. Returns NULL upon failure. */ extern char * compute_curr_prefix (const char *orig_installprefix, const char *orig_installdir, - const char *curr_pathname); + const char *curr_pathname) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE; #else -- 2.39.5