The clang warning option -Wthread-safety is useful for some modules (see <https://lists.gnu.org/archive/html/bug-gnulib/2024-09/msg00130.html>). 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 does not support this option. 2024-09-25 Bruno Haible <br...@clisp.org> manywarnings: Enable -Wthread-safety for clang. * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC(C)): Enable -Wthread-safety if supported. diff --git a/m4/manywarnings.m4 b/m4/manywarnings.m4 index 5b0baee205..3ccf405d2a 100644 --- a/m4/manywarnings.m4 +++ b/m4/manywarnings.m4 @@ -1,5 +1,5 @@ # manywarnings.m4 -# serial 27 +# serial 28 dnl Copyright (C) 2008-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -185,6 +185,9 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC(C esac fi + # These options are not supported by gcc, but are useful with clang. + AS_VAR_APPEND([$1], [' -Wthread-safety']) + # Disable specific options as needed. if test "$gl_cv_cc_nomfi_needed" = yes; then AS_VAR_APPEND([$1], [' -Wno-missing-field-initializers'])