fix(ci): fix clang-21 static analyzer false positives

scan-build-21 reports false positive bugs in the posix eventloop code, causing some CI jobs to fail
This commit is contained in:
Niels Beier
2026-05-11 22:59:04 +02:00
committed by Julius Pfrommer
parent e3f0c15a71
commit 4cd3fac3a2
4 changed files with 13 additions and 5 deletions
+1 -1
View File
@@ -352,7 +352,7 @@ ETH_connectionSocketCallback(UA_ConnectionManager *cm, UA_RegisteredFD *rfd,
/* Receive has failed */
if(ret <= 0) {
if(UA_ERRNO == UA_INTERRUPTED)
if(ret < 0 && UA_ERRNO == UA_INTERRUPTED)
return;
/* Orderly shutdown of the socket. We can immediately close as no method
+3 -3
View File
@@ -283,9 +283,9 @@ TCP_connectionSocketCallback(UA_ConnectionManager *cm, TCP_FD *conn,
/* Receive has failed */
if(ret <= 0) {
if(UA_ERRNO == UA_INTERRUPTED ||
UA_ERRNO == UA_WOULDBLOCK ||
UA_ERRNO == UA_AGAIN)
if(ret < 0 && (UA_ERRNO == UA_INTERRUPTED ||
UA_ERRNO == UA_WOULDBLOCK ||
UA_ERRNO == UA_AGAIN))
return; /* Temporary error on an non-blocking socket */
/* Orderly shutdown of the socket */
+1 -1
View File
@@ -695,7 +695,7 @@ UDP_connectionSocketCallback(UA_POSIXConnectionManager *pcm, UDP_FD *conn,
/* Receive has failed */
if(ret <= 0) {
if(UA_ERRNO == UA_INTERRUPTED)
if(ret < 0 && UA_ERRNO == UA_INTERRUPTED)
return;
/* Orderly shutdown of the socket. We can immediately close as no method
+8
View File
@@ -531,10 +531,18 @@ function build_clang_analyzer {
-DUA_FORCE_WERROR=ON \
-DUA_NAMESPACE_ZERO=FULL \
..
# Disable checkers that produce false positives in the posix eventloop code
local checker_flags=""
if [ "$version" = "21" ]; then
checker_flags="-disable-checker unix.Errno -disable-checker unix.BlockInCriticalSection"
fi
scan-build-$version \
--status-bugs \
--exclude ../src/util \
--exclude ../tests \
--exclude ../examples \
--exclude ../deps \
$checker_flags \
make ${MAKEOPTS}
}