bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

relocatable-lib-lgpl: Improve GCC 11 allocation-deallocation checking


From: Bruno Haible
Subject: relocatable-lib-lgpl: Improve GCC 11 allocation-deallocation checking
Date: Sat, 07 Aug 2021 22:05:52 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-210-generic; KDE/5.18.0; x86_64; ; )

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'.

diff --git a/lib/relocatable.h b/lib/relocatable.h
index 25a0b41..2ffb75e 100644
--- a/lib/relocatable.h
+++ b/lib/relocatable.h
@@ -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
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]