From 8af7649e2aa594432c53f26cc7dafc0f8d2c13b3 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 7 Aug 2021 19:36:50 +0200 Subject: [PATCH] get_progname_of: Improve GCC 11 allocation-deallocation checking. * lib/get_progname_of.h: Include . (get_progname_of): Declare that deallocation must happen through 'free'. --- ChangeLog | 6 ++++++ lib/get_progname_of.h | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c8e20f5338..2eb280adf5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2021-08-07 Bruno Haible + + get_progname_of: Improve GCC 11 allocation-deallocation checking. + * lib/get_progname_of.h: Include . + (get_progname_of): Declare that deallocation must happen through 'free'. + 2021-08-07 Bruno Haible fts: Improve GCC 11 allocation-deallocation checking. diff --git a/lib/get_progname_of.h b/lib/get_progname_of.h index 9270301439..a4662143da 100644 --- a/lib/get_progname_of.h +++ b/lib/get_progname_of.h @@ -18,6 +18,7 @@ #ifndef _GET_PROGNAME_OF_H #define _GET_PROGNAME_OF_H +#include #include #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 } -- 2.39.5