libuv: Suppress clang-analyzer warnings

This commit is contained in:
Brad King 2023-05-22 09:59:44 -04:00
parent 5ec464a76f
commit b18eca763c
2 changed files with 10 additions and 0 deletions

View File

@ -354,6 +354,10 @@ uv_handle_type uv_guess_handle(uv_file file) {
socklen_t len;
int type;
#ifdef __clang_analyzer__
memset(&ss, 0, sizeof(ss));
#endif
if (file < 0)
return UV_UNKNOWN_HANDLE;

View File

@ -194,6 +194,12 @@ static int uv__udp_recvmmsg(uv_udp_t* handle, uv_buf_t* buf) {
int flags;
size_t k;
#ifdef __clang_analyzer__
/* Tell clang-analyzer the array is initialized.
The part we use is initialized below. */
memset(iov, 0, sizeof(iov));
#endif
/* prepare structures for recvmmsg */
chunks = buf->len / UV__UDP_DGRAM_MAXSIZE;
if (chunks > ARRAY_SIZE(iov))