浏览代码

bzip2: Suppress clang-analyzer warnings

Brad King 2 年之前
父节点
当前提交
91e4d27765
共有 2 个文件被更改,包括 12 次插入0 次删除
  1. 4 0
      Utilities/cmbzip2/bzlib.c
  2. 8 0
      Utilities/cmbzip2/compress.c

+ 4 - 0
Utilities/cmbzip2/bzlib.c

@@ -444,6 +444,10 @@ int BZ_API(BZ2_bzCompress) ( bz_stream *strm, int action )
          if (s->avail_in_expect != s->strm->avail_in) 
             return BZ_SEQUENCE_ERROR;
          progress = handle_compress ( strm );
+         #ifdef __clang_analyzer__
+         /* Tolerate deadcode.DeadStores to avoid modifying upstream.  */
+         (void)progress;
+         #endif
          if (s->avail_in_expect > 0 || !isempty_RL(s) ||
              s->state_out_pos < s->numZ) return BZ_FLUSH_OK;
          s->mode = BZ_M_RUNNING;

+ 8 - 0
Utilities/cmbzip2/compress.c

@@ -151,6 +151,10 @@ void generateMTFValues ( EState* s )
    UChar* block  = s->block;
    UInt16* mtfv  = s->mtfv;
 
+#ifdef __clang_analyzer__
+   memset(yy, 0, sizeof(yy));
+#endif
+
    makeMaps_e ( s );
    EOB = s->nInUse+1;
 
@@ -223,6 +227,10 @@ void generateMTFValues ( EState* s )
          zPend = (zPend - 2) / 2;
       };
       zPend = 0;
+      #ifdef __clang_analyzer__
+      /* Tolerate deadcode.DeadStores to avoid modifying upstream.  */
+      (void)zPend;
+      #endif
    }
 
    mtfv[wr] = EOB; wr++; s->mtfFreq[EOB]++;