manywarnings: Enable -Wthread-safety for clang

2024-09-25 Thread Bruno Haible
The clang warning option -Wthread-safety is useful for some modules (see ). Since it is not part of -Wall, it makes sense to enable it through the 'manywarnings' module. This patch does it. It has no effect for GCC, since GCC doe

relocatable-lib-lgpl: Add support for mingw builds on Cygwin hosts

2024-09-25 Thread Bruno Haible
Michele Locati noticed that when building a package for mingw, on Cygwin as host environment, the --enable-relocatable option does not fully work: Binaries are installed where they should, but when moved on the file system, they don't find their (relocated) files. Two values were wrong: - the va

new module xstring-buffer

2024-09-25 Thread Bruno Haible
This patch adds a module 'xstring-buffer', that complements the 'string-buffer' API with function that bail out upon out-of-memory. Which is obviously useful for code that sits in a program (as opposed to a library). 2024-09-25 Bruno Haible xstring-buffer: New module. * lib/st

string-buffer: Add more API

2024-09-25 Thread Bruno Haible
While making use of the 'string-buffer' module in GNU gettext, I noticed that more API is needed, to cover the frequent use-cases. For code that is not performance-critical, the benefits of this module are: - You need to declare one variable instead of 3 variables. - It moves the xrealloc logi

string-buffer: Enable resource leak warnings from clang

2024-09-25 Thread Bruno Haible
In C++, every local variable of struct (or class) type has its constructor run at the start of the scope, and the destructor runs at the end of the scope. This idiom is useful for avoiding resource leaks, such as memory leaks. In C, we don't have constructors and destructors in the language, but t