]> Savannah Git Hosting - gnulib.git/commit
string-buffer: Enable resource leak warnings from clang.
authorBruno Haible <bruno@clisp.org>
Wed, 25 Sep 2024 14:21:12 +0000 (16:21 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 25 Sep 2024 14:21:12 +0000 (16:21 +0200)
commit2bbbc32f1527981473ed403d87c7f3ddbb906634
treeab13e9613d070063a6961f7b47877cb29cb245fa
parent778a55c4a8288e722a6d2d7a2997d87c4d1c67ba
string-buffer: Enable resource leak warnings from clang.

* m4/gnulib-common.m4 (gl_COMMON_BODY): Define the macros
_GL_ATTRIBUTE_CAPABILITY_TYPE, _GL_ATTRIBUTE_ACQUIRE_CAPABILITY,
_GL_ATTRIBUTE_RELEASE_CAPABILITY.
* lib/string-buffer.h (sb_heap_allocated_pointer_t): New type.
(struct string_buffer): Use it.
(sb_init): Mark with _GL_ATTRIBUTE_ACQUIRE_CAPABILITY.
(sb_free, sb_dupfree): Mark with _GL_ATTRIBUTE_RELEASE_CAPABILITY.
* lib/string-buffer.c: Silence the -Wthread-safety warnings in this
compilation unit.
ChangeLog
lib/string-buffer.c
lib/string-buffer.h
m4/gnulib-common.m4