]> Savannah Git Hosting - gnulib.git/commitdiff
areadlink, areadlinkat: Improve GCC 11 allocation-deallocation checking.
authorBruno Haible <bruno@clisp.org>
Sat, 7 Aug 2021 16:55:45 +0000 (18:55 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 7 Aug 2021 16:55:45 +0000 (18:55 +0200)
* lib/areadlink.h: Include <stdlib.h> instead of <stddef.h>.
(areadlink, areadlink_with_size, areadlinkat, areadlinkat_with_size):
Declare that deallocation must happen through 'free'.

ChangeLog
lib/areadlink.h

index 1ef6f6b34cf92e4933e38337cb783072de395f16..8039f31483da8c526991c28a12ff710735174291 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2021-08-07  Bruno Haible  <bruno@clisp.org>
+
+       areadlink, areadlinkat: Improve GCC 11 allocation-deallocation checking.
+       * lib/areadlink.h: Include <stdlib.h> instead of <stddef.h>.
+       (areadlink, areadlink_with_size, areadlinkat, areadlinkat_with_size):
+       Declare that deallocation must happen through 'free'.
+
 2021-08-07  Bruno Haible  <bruno@clisp.org>
 
        stdio: Improve GCC 11 allocation-deallocation checking.
index a3511505d449cb14287228d9308f2559b5dcf930..1d0629e25efa51171acee8c2d0a5d0abb38b83f1 100644 (file)
 
 /* Written by Jim Meyering <jim@meyering.net>  */
 
-#include <stddef.h>
+#include <stdlib.h>
 
-extern char *areadlink (char const *filename);
-extern char *areadlink_with_size (char const *filename, size_t size_hint);
+extern char *areadlink (char const *filename)
+  _GL_ATTRIBUTE_DEALLOC_FREE;
+extern char *areadlink_with_size (char const *filename, size_t size_hint)
+  _GL_ATTRIBUTE_DEALLOC_FREE;
 
 #if GNULIB_AREADLINKAT
-extern char *areadlinkat (int fd, char const *filename);
+extern char *areadlinkat (int fd, char const *filename)
+  _GL_ATTRIBUTE_DEALLOC_FREE;
 #endif
 
 #if GNULIB_AREADLINKAT_WITH_SIZE
 extern char *areadlinkat_with_size (int fd, char const *filename,
-                                    size_t size_hint);
+                                    size_t size_hint)
+  _GL_ATTRIBUTE_DEALLOC_FREE;
 #endif