ot-br-posix: Do not error on sign-compare with musl and clang

musl's CMSG_NXTHDR compares a size_t with a ptrdiff_t, which clang
reports under -Wextra when the macro is expanded in openthread's posix
platform code, and -Werror turns it into:

  infra_if.cpp:275:31: fatal error: comparison of integers of different signs: '__size_t' (aka 'unsigned long') and '__ptrdiff_t' (aka 'long') [-Wsign-compare]

This used to be handled by meta-clang's nonclangable.conf. Do the same
as oe-core's seatd recipe.

AI-Generated: Uses Claude Code
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
This commit is contained in:
Khem Raj committed 2026-11-11 22:46:11 -08:00
1 parent edd2f0d87e
commit 9b67c47ae2
1 file changed
+2
@@ -27,6 +27,8 @@ inherit pkgconfig cmake systemd
# Use -std=c++20 for fixing
# recipe-sysroot/usr/include/c++/15.1.0/ciso646:46:4: error: #warning "<ciso646> is deprecated in C++17, use <version> to detect implementation-specific macros" [-Werror=cpp]
CXXFLAGS += "-std=c++20 -Wno-error=attributes"
# musl CMSG_NXTHDR mixes size_t and ptrdiff_t
CXXFLAGS:append:libc-musl:toolchain-clang = " -Wno-error=sign-compare"
LDFLAGS:append:riscv32 = " -latomic"
EXTRA_OECMAKE = "-DBUILD_TESTING=OFF \