From: Bruno Haible Date: Sat, 7 Aug 2021 17:27:05 +0000 (+0200) Subject: [x]concat-filename: Improve GCC 11 allocation-deallocation checking. X-Git-Tag: v1.0~2705 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=56312173b134d4a3ea217a24aef4ea82b1f1e380;p=gnulib.git [x]concat-filename: Improve GCC 11 allocation-deallocation checking. * lib/concat-filename.h: Include . (concatenated_filename, xconcatenated_filename): Declare that deallocation must happen through 'free'. --- diff --git a/ChangeLog b/ChangeLog index 67019f31b1..29f41d707b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2021-08-07 Bruno Haible + + [x]concat-filename: Improve GCC 11 allocation-deallocation checking. + * lib/concat-filename.h: Include . + (concatenated_filename, xconcatenated_filename): Declare that + deallocation must happen through 'free'. + 2021-08-07 Bruno Haible clean-temp: Improve GCC 11 allocation-deallocation checking. diff --git a/lib/concat-filename.h b/lib/concat-filename.h index 5a7d3934a0..32a437ec60 100644 --- a/lib/concat-filename.h +++ b/lib/concat-filename.h @@ -17,6 +17,8 @@ #ifndef _CONCAT_FILENAME_H #define _CONCAT_FILENAME_H +#include + #ifdef __cplusplus extern "C" { #endif @@ -26,12 +28,15 @@ extern "C" { suffix. Return a freshly allocated filename. Return NULL and set errno upon memory allocation failure. */ extern char *concatenated_filename (const char *directory, - const char *filename, const char *suffix); + const char *filename, const char *suffix) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE; /* Concatenate a directory filename, a relative filename and an optional suffix. Return a freshly allocated filename. */ extern char *xconcatenated_filename (const char *directory, - const char *filename, const char *suffix); + const char *filename, const char *suffix) + _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE + _GL_ATTRIBUTE_RETURNS_NONNULL; #ifdef __cplusplus