diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2025-12-25 19:44:34 +0100 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2026-01-02 21:49:54 +0100 |
| commit | 02624874966d57e482baa6f0d1e87c37608506dc (patch) | |
| tree | 9537a08c56cde3a5ae7859bb6eea20a4de68c08b | |
| parent | 3015ca9407d14876b1b6e8babc5b94acd939af68 (diff) | |
bsd.sys.mk: suppress some new clang 21 warnings for C++
Otherwise, these lead to many -Werror warnings in libc++ headers, due to
our use of -Wsystem-headers, which is not officially supported upstream:
Suppress -Wc++20-extensions, due to:
/usr/include/c++/v1/__algorithm/simd_utils.h:96:50: error: explicit template parameter list for lambdas is a C++20 extension [-Werror,-Wc++20-extensions]
96 | inline constexpr size_t __simd_vector_size_v = []<bool _False = false>() -> size_t {
| ^
Suppress -Wc++23-lambda-attributes, due to:
/usr/include/c++/v1/__format/format_functions.h:462:32: error: an attribute specifier sequence in this position is a C++23 extension [-Werror,-Wc++23-lambda-attributes]
462 | if (bool __is_identity = [&] [[__gnu__::__pure__]] // Make sure the compiler knows this call can be eliminated
| ^
Suppress -Wnullability-completeness, due to:
/usr/include/c++/v1/string:1068:80: error: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Werror,-Wnullability-completeness]
1068 | _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT* __s, size_type __n) {
| ^
MFC after: 3 days
(cherry picked from commit 63d1c3c43690ff3c3e76e1fb03c8640fe30a2663)
| -rw-r--r-- | share/mk/bsd.sys.mk | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index e537d7f045c4..e3401bb35e77 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -99,6 +99,11 @@ CWARNFLAGS.clang+= -Wno-error=unused-but-set-parameter # Similar to gcc >= 8.1 -Wno-error=cast-function-type below CWARNFLAGS.clang+= -Wno-error=cast-function-type-mismatch .endif +.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 210000 +CXXWARNFLAGS.clang+= -Wno-c++20-extensions +CXXWARNFLAGS.clang+= -Wno-c++23-lambda-attributes +CXXWARNFLAGS.clang+= -Wno-nullability-completeness +.endif .endif # WARNS <= 6 .if ${WARNS} <= 3 CWARNFLAGS.clang+= -Wno-tautological-compare -Wno-unused-value\ |
