Skip to content

Commit

Permalink
[fuzz] Turn off -Werror by default
Browse files Browse the repository at this point in the history
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
  • Loading branch information
terrelln committed Mar 26, 2024
1 parent 78f732c commit 81a5e5d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion tests/fuzz/fuzz.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/fuzz/sequence_compression_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
} }
Expand Down

0 comments on commit 81a5e5d

Please sign in to comment.