Skip to content

Commit b4cc084

Browse files
bump projects with FDP and c++11 to c++17 (#13916)
Addressing projects that have errors like the following: ```sh Step #23 - "compile-libfuzzer-address-x86_64": �[1m/usr/local/lib/clang/21/include/fuzzer/FuzzedDataProvider.h:206:22: �[0m�[0;1;31merror: �[0m�[1mno template named 'is_integral_v' in namespace 'std'; did you mean 'is_integral'?�[0m Step #23 - "compile-libfuzzer-address-x86_64": 206 | �[0;34mstatic_assert�[0m(std::is_integral_v<T>, �[0;32m"An integral type is required."�[0m);�[0m Step #23 - "compile-libfuzzer-address-x86_64": | �[0;1;32m ~~~~~^ Step #23 - "compile-libfuzzer-address-x86_64": �[0m�[1m/usr/local/bin/../include/c++/v1/__type_traits/is_integral.h:25:35: �[0m�[0;1;36mnote: �[0m'is_integral' declared here�[0m Step #23 - "compile-libfuzzer-address-x86_64": 25 | �[0;34mstruct�[0m _LIBCPP_NO_SPECIALIZATIONS is_integral : _BoolConstant<�[0;34m__is_integral�[0m(_Tp)> {};�[0m Step #23 - "compile-libfuzzer-address-x86_64": | �[0;1;32m ^ Step #23 - "compile-libfuzzer-address-x86_64": �[0mIn file included from /src/buffer_fuzzer.cc:19: Step #23 - "compile-libfuzzer-address-x86_64": �[1m/usr/local/lib/clang/21/include/fuzzer/FuzzedDataProvider.h:206:38: �[0m�[0;1;31merror: �[0m�[1mexpected '(' for function-style cast or type construction�[0m Step #23 - "compile-libfuzzer-address-x86_64": 206 | �[0;34mstatic_assert�[0m(std::is_integral_v<T>, �[0;32m"An integral type is required."�[0m);�[0m Step #23 - "compile-libfuzzer-address-x86_64": | �[0;1;32m ~~~~~~~~~~~~~~~~~~~~~^ Step #23 - "compile-libfuzzer-address-x86_64": �[0m�[1m/usr/local/lib/clang/21/include/fuzzer/FuzzedDataProvider.h:274:22: �[0m�[0;1;31merror: �[0m�[1mno template named 'is_floating_point_v' in namespace 'std'; did you mean 'is_floating_point'?�[0m Step #23 - "compile-libfuzzer-address-x86_64": 274 | �[0;34mstatic_assert�[0m(std::is_floating_point_v<T>,�[0m ``` From #13848 (comment) Ref #13915 --------- Signed-off-by: David Korczynski <[email protected]>
1 parent 63ad3a5 commit b4cc084

File tree

9 files changed

+19
-15
lines changed

9 files changed

+19
-15
lines changed

projects/astc-encoder/build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@
1616
################################################################################
1717

1818
# build project and project-hosted fuzzers
19+
sed -i 's/c++14/c++17/g' $SRC/astc-encoder/Source/Fuzzers/build.sh
1920
$SRC/astc-encoder/Source/Fuzzers/build.sh

projects/easywsclient/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717

1818
for f in $(find $SRC -name '*_fuzzer.cpp'); do
1919
b=$(basename -s .cpp $f)
20-
$CXX $CXXFLAGS -std=c++11 -g easywsclient.cpp -I. \
20+
$CXX $CXXFLAGS -std=c++17 -g easywsclient.cpp -I. \
2121
$f -o $OUT/$b $LIB_FUZZING_ENGINE
2222
done

projects/json-c/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ cp $SRC/json-c/fuzz/*.dict $OUT/
2424

2525
for f in $SRC/json-c/fuzz/*_fuzzer.cc; do
2626
fuzzer=$(basename "$f" _fuzzer.cc)
27-
$CXX $CXXFLAGS -std=c++11 -I$SRC/json-c -I$SRC/json-c/json-c-build\
27+
$CXX $CXXFLAGS -std=c++17 -I$SRC/json-c -I$SRC/json-c/json-c-build\
2828
$SRC/json-c/fuzz/${fuzzer}_fuzzer.cc -o $OUT/${fuzzer}_fuzzer \
2929
$LIB_FUZZING_ENGINE $SRC/json-c/json-c-build/libjson-c.a
3030
done

projects/libevent/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ make install
3030
# build fuzzer
3131
for fuzzers in $(find $SRC -name '*_fuzzer.cc'); do
3232
fuzz_basename=$(basename -s .cc $fuzzers)
33-
$CXX $CXXFLAGS -std=c++11 -I../ -Iinclude \
33+
$CXX $CXXFLAGS -std=c++17 -I../ -Iinclude \
3434
$fuzzers $LIB_FUZZING_ENGINE ./lib/libevent.a ./lib/libevent_core.a \
3535
./lib/libevent_pthreads.a ./lib/libevent_extra.a \
3636
-o $OUT/$fuzz_basename

projects/libgd/build.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,18 @@ sed -i'' -e 's/INT_MAX/100000/' "$SRC/libgd/src/gd_security.c"
2525
./configure --prefix="$WORK" --disable-shared
2626
make -j$(nproc) install
2727

28+
export CXXFLAGS="${CXXFLAGS} -std=c++17"
2829
for target in Bmp Gd Gd2 Gif Jpeg Png Tga Tiff WBMP Webp; do
2930
lowercase=$(echo $target | tr "[:upper:]" "[:lower:]")
30-
$CXX $CXXFLAGS -std=c++11 -I"$WORK/include" -L"$WORK/lib" \
31+
$CXX $CXXFLAGS -I"$WORK/include" -L"$WORK/lib" \
3132
-DFUZZ_GD_FORMAT=$target \
3233
$SRC/parser_target.cc -o $OUT/${lowercase}_target \
3334
$LIB_FUZZING_ENGINE -lgd -Wl,-Bstatic -lz -Wl,-Bdynamic
3435
done
3536

3637
for fuzzers in $(find $SRC -name '*_fuzzer.cc'); do
3738
fuzz_basename=$(basename -s .cc $fuzzers)
38-
$CXX $CXXFLAGS -std=c++11 -I"$WORK/include" -L"$WORK/lib" \
39+
$CXX $CXXFLAGS -I"$WORK/include" -L"$WORK/lib" \
3940
$fuzzers -o $OUT/$fuzz_basename \
4041
$LIB_FUZZING_ENGINE -lgd -Wl,-Bstatic -lz -Wl,-Bdynamic
4142
done

projects/libraw/build.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,19 @@ autoreconf --install
2727
make
2828

2929
# build fuzzers
30-
$CXX $CXXFLAGS -std=c++11 -Ilibraw \
30+
export CXXFLAGS="${CXXFLAGS} -std=c++17"
31+
$CXX $CXXFLAGS -Ilibraw \
3132
$SRC/libraw_fuzzer.cc -o $OUT/libraw_fuzzer \
3233
$LIB_FUZZING_ENGINE -lz lib/.libs/libraw.a
3334

34-
$CXX $CXXFLAGS -std=c++11 -Ilibraw \
35+
$CXX $CXXFLAGS -Ilibraw \
3536
$SRC/libraw_fuzzer.cc -o $OUT/libraw_cr2_fuzzer \
3637
$LIB_FUZZING_ENGINE -lz lib/.libs/libraw.a
3738

38-
$CXX $CXXFLAGS -std=c++11 -Ilibraw \
39+
$CXX $CXXFLAGS -Ilibraw \
3940
$SRC/libraw_fuzzer.cc -o $OUT/libraw_nef_fuzzer \
4041
$LIB_FUZZING_ENGINE -lz lib/.libs/libraw.a
4142

42-
$CXX $CXXFLAGS -std=c++11 -Ilibraw \
43+
$CXX $CXXFLAGS -Ilibraw \
4344
$SRC/libraw_fuzzer.cc -o $OUT/libraw_raf_fuzzer \
4445
$LIB_FUZZING_ENGINE -lz lib/.libs/libraw.a

projects/libusb/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ make -j$(nproc) all
2323
# build fuzzer
2424
for fuzzer in $(find $SRC -name '*_fuzzer.cc'); do
2525
fuzzer_basename=$(basename -s .cc $fuzzer)
26-
$CXX $CXXFLAGS -std=c++11 -I. \
26+
$CXX $CXXFLAGS -std=c++17 -I. \
2727
$fuzzer $LIB_FUZZING_ENGINE ./libusb/.libs/libusb-1.0.a \
2828
-lpthread -ludev \
2929
-o $OUT/$fuzzer_basename

projects/lzo/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ for file in $SRC/*.c;
2626
do
2727
name=$(basename $file .c)
2828
$CC $CFLAGS -c -I include -I minilzo -I include/lzo ${file} -o ${name}.o
29-
$CXX $CXXFLAGS -std=c++11 -I include -I minilzo -I include/lzo ${name}.o \
29+
$CXX $CXXFLAGS -std=c++17 -I include -I minilzo -I include/lzo ${name}.o \
3030
-o $OUT/${name} $LIB_FUZZING_ENGINE src/.libs/liblzo2.a
3131
done
3232

33-
$CXX $CXXFLAGS -std=c++11 -I include -I minilzo -I include/lzo \
33+
$CXX $CXXFLAGS -std=c++17 -I include -I minilzo -I include/lzo \
3434
$SRC/all_lzo_compress.cc \
3535
-o $OUT/all_lzo_compress $LIB_FUZZING_ENGINE src/.libs/liblzo2.a
3636

projects/nghttp2/build.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,17 @@ cmake -DENABLE_LIB_ONLY=ON -DBUILD_STATIC_LIBS=ON ../
2121
make
2222
make check
2323

24-
$CXX $CXXFLAGS -std=c++11 -I../lib/includes -Ilib/includes -I../lib/ -I../tests/ \
24+
export CXXFLAGS="${CXXFLAGS} -std=c++17"
25+
$CXX $CXXFLAGS -I../lib/includes -Ilib/includes -I../lib/ -I../tests/ \
2526
../fuzz/fuzz_frames.cc -o $OUT/nghttp2_fuzzer_frames \
2627
tests/CMakeFiles/main.dir/nghttp2_test_helper.c.o \
2728
$LIB_FUZZING_ENGINE lib/libnghttp2.a
2829

29-
$CXX $CXXFLAGS -std=c++11 -I../lib/includes -Ilib/includes -I../lib/ \
30+
$CXX $CXXFLAGS -I../lib/includes -Ilib/includes -I../lib/ \
3031
../fuzz/fuzz_target.cc -o $OUT/nghttp2_fuzzer \
3132
$LIB_FUZZING_ENGINE lib/libnghttp2.a
3233

33-
$CXX $CXXFLAGS -std=c++11 -I../lib/includes -Ilib/includes -I../lib/ \
34+
$CXX $CXXFLAGS -I../lib/includes -Ilib/includes -I../lib/ \
3435
../fuzz/fuzz_target_fdp.cc -o $OUT/nghttp2_fuzzer_fdp \
3536
$LIB_FUZZING_ENGINE lib/libnghttp2.a
3637

0 commit comments

Comments
 (0)