]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
[fuzz] Turn off -Werror by default
authorNick Terrell <terrelln@fb.com>
Tue, 26 Mar 2024 17:01:19 +0000 (10:01 -0700)
committerNick Terrell <nickrterrell@gmail.com>
Tue, 26 Mar 2024 23:34:36 +0000 (16:34 -0700)
This was causing OSS-Fuzz errors, due to compiler differences.
* Fix the issue
* Also turn off -Werror so we don't fail fuzzer builds for warnings
* Turn on -Werror in our CI

Makefile
tests/fuzz/fuzz.py
tests/fuzz/sequence_compression_api.c

index 11eca19ce209be630637860fbed5a2b81d0d515a..b2d985feb5dd8f8db269bf86f6cdc0f7d358b1a0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -293,10 +293,10 @@ regressiontest:
        $(MAKE) -C $(FUZZDIR) regressiontest
 
 uasanregressiontest:
-       $(MAKE) -C $(FUZZDIR) regressiontest CC=clang CXX=clang++ CFLAGS="-O3 -fsanitize=address,undefined" CXXFLAGS="-O3 -fsanitize=address,undefined"
+       $(MAKE) -C $(FUZZDIR) regressiontest CC=clang CXX=clang++ CFLAGS="-O3 -fsanitize=address,undefined -Werror" CXXFLAGS="-O3 -fsanitize=address,undefined -Werror"
 
 msanregressiontest:
-       $(MAKE) -C $(FUZZDIR) regressiontest CC=clang CXX=clang++ CFLAGS="-O3 -fsanitize=memory" CXXFLAGS="-O3 -fsanitize=memory"
+       $(MAKE) -C $(FUZZDIR) regressiontest CC=clang CXX=clang++ CFLAGS="-O3 -fsanitize=memory -Werror" CXXFLAGS="-O3 -fsanitize=memory -Werror"
 
 update_regressionResults : REGRESS_RESULTS_DIR := /tmp/regress_results_dir/
 update_regressionResults:
index d59df926187d8bb3762182e9f06608269c65f32d..492be3486d0dda9efee190c9e2a2853084d84558 100755 (executable)
@@ -408,7 +408,6 @@ def build(args):
     mflags = shlex.split(args.mflags)
     # Flags to be added to both cflags and cxxflags
     common_flags = [
-        '-Werror',
         '-Wno-error=declaration-after-statement',
         '-Wno-error=c++-compat',
         '-Wno-error=deprecated' # C files are sometimes compiled with CXX
index ec0106c18c67b334a485a29dd64a6fc6ecf8a84d..3c60f42c6bfd65936aa4828ddb9651bff38967a8 100644 (file)
@@ -127,7 +127,7 @@ static size_t decodeSequences(void* dst, size_t nbSequences,
     FUZZ_ASSERT(litPtr <= litEnd);
     if (mode == ZSTD_sf_noBlockDelimiters) {
         const uint32_t lastLLSize = (uint32_t)(litEnd - litPtr);
-        if (lastLLSize <= oend - op) {
+        if (lastLLSize <= (uint32_t)(oend - op)) {
             memcpy(op, litPtr, lastLLSize);
             generatedSrcBufferSize += lastLLSize;
     }   }