Ver Fonte

libuv: Suppress clang-analyzer warnings

Brad King há 2 anos atrás
pai
commit
b18eca763c
2 ficheiros alterados com 10 adições e 0 exclusões
  1. 4 0
      Utilities/cmlibuv/src/unix/tty.c
  2. 6 0
      Utilities/cmlibuv/src/unix/udp.c

+ 4 - 0
Utilities/cmlibuv/src/unix/tty.c

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

+ 6 - 0
Utilities/cmlibuv/src/unix/udp.c

@@ -194,6 +194,12 @@ static int uv__udp_recvmmsg(uv_udp_t* handle, uv_buf_t* buf) {
   int flags;
   int flags;
   size_t k;
   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 */
   /* prepare structures for recvmmsg */
   chunks = buf->len / UV__UDP_DGRAM_MAXSIZE;
   chunks = buf->len / UV__UDP_DGRAM_MAXSIZE;
   if (chunks > ARRAY_SIZE(iov))
   if (chunks > ARRAY_SIZE(iov))