mirror of
https://github.com/open62541/open62541.git
synced 2026-10-27 03:27:40 +08:00
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:
committed by
Julius Pfrommer
parent
e3f0c15a71
commit
4cd3fac3a2
@@ -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
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user