bug-gnulib
[Top][All Lists]
Advanced

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

areadlink, areadlinkat: Improve GCC 11 allocation-deallocation checking


From: Bruno Haible
Subject: areadlink, areadlinkat: Improve GCC 11 allocation-deallocation checking
Date: Sat, 07 Aug 2021 18:56:55 +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>

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

diff --git a/lib/areadlink.h b/lib/areadlink.h
index a351150..1d0629e 100644
--- a/lib/areadlink.h
+++ b/lib/areadlink.h
@@ -18,16 +18,20 @@
 
 /* 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




reply via email to

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