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

ChangeLog
lib/get_progname_of.h

index c8e20f5338b635e1c0a7eaa782094040b24285ff..2eb280adf5214432ef00d958df407a789a048fe5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2021-08-07  Bruno Haible  <bruno@clisp.org>
+
+       get_progname_of: Improve GCC 11 allocation-deallocation checking.
+       * lib/get_progname_of.h: Include <stdlib.h>.
+       (get_progname_of): Declare that deallocation must happen through 'free'.
+
 2021-08-07  Bruno Haible  <bruno@clisp.org>
 
        fts: Improve GCC 11 allocation-deallocation checking.
index 927030143989e9b10bfa1f2142c4224b893fae57..a4662143da81ad6c0bc410cba30438df947730fe 100644 (file)
@@ -18,6 +18,7 @@
 #ifndef _GET_PROGNAME_OF_H
 #define _GET_PROGNAME_OF_H
 
+#include <stdlib.h>
 #include <sys/types.h>
 
 #ifdef __cplusplus
@@ -27,7 +28,8 @@ extern "C" {
 /* Returns the base name of the program that executes the given process,
    possibly truncated, as a freshly allocated string, or NULL if it cannot
    be determined.  */
-extern char *get_progname_of (pid_t pid);
+extern char *get_progname_of (pid_t pid)
+  _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
 
 #ifdef __cplusplus
 }