]> Savannah Git Hosting - gnulib.git/commitdiff
relocatable-lib-lgpl: Improve GCC 11 allocation-deallocation checking.
authorBruno Haible <bruno@clisp.org>
Sat, 7 Aug 2021 20:04:55 +0000 (22:04 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 7 Aug 2021 20:04:55 +0000 (22:04 +0200)
* lib/relocatable.h: Include <stdlib.h>.
(compute_curr_prefix): Declare that deallocation must happen through
'free'.

ChangeLog
lib/relocatable.h

index ac96080531f2394670abc6d88e369c24304cef34..89e3f5551d8ba95404b80ca4784c7ed2f3ad9361 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2021-08-07  Bruno Haible  <bruno@clisp.org>
+
+       relocatable-lib-lgpl: Improve GCC 11 allocation-deallocation checking.
+       * lib/relocatable.h: Include <stdlib.h>.
+       (compute_curr_prefix): Declare that deallocation must happen through
+       'free'.
+
 2021-08-07  Bruno Haible  <bruno@clisp.org>
 
        regex-quote: Improve GCC 11 allocation-deallocation checking.
index 25a0b41ae41fccdcde31ff159d713f100dad9a9a..2ffb75e99c820afff0fe8251da9aa17a2bcd2cd8 100644 (file)
@@ -18,6 +18,8 @@
 #ifndef _RELOCATABLE_H
 #define _RELOCATABLE_H
 
+#include <stdlib.h>
+
 #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