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

ChangeLog
lib/string-buffer.h

index aed8b7bd0aaaec0a2c76fba9e3e1a3fd6054325f..b87440ed060a9f49a3e2a4a62a0e7dde1ae8c7ab 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2021-08-07  Bruno Haible  <bruno@clisp.org>
+
+       string-buffer: Improve GCC 11 allocation-deallocation checking.
+       * lib/string-buffer.h: Include <stdlib.h> instead of <stddef.h>.
+       (sb_dupfree): Declare that deallocation must happen through 'free'.
+
 2021-08-07  Bruno Haible  <bruno@clisp.org>
 
        striconveha: Improve GCC 11 allocation-deallocation checking.
index 129dcebe6ed2cb40a960c74700055ba68eeceb8a..2dae5da8899528427d369e932e4ee175344a7a73 100644 (file)
@@ -21,7 +21,7 @@
 
 #include <stdarg.h>
 #include <stdbool.h>
-#include <stddef.h>
+#include <stdlib.h>
 
 #include "attribute.h"
 
@@ -76,7 +76,8 @@ extern void sb_free (struct string_buffer *buffer);
 /* Returns the contents of BUFFER, and frees all other memory held
    by BUFFER.  Returns NULL upon failure or if there was an error earlier.
    It is the responsibility of the caller to free() the result.  */
-extern char * sb_dupfree (struct string_buffer *buffer);
+extern char * sb_dupfree (struct string_buffer *buffer)
+  _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
 
 #ifdef __cplusplus
 }