Make fuzzers C++ programs, not C

Using https://github.com/google/oss-fuzz on .c files says:

clang-7.0: warning: treating 'c' input as 'c++' when in C++ mode, this
behavior is deprecated [-Wdeprecated]
This commit is contained in:
Nigel Tao committed 2018-02-17 15:41:21 +11:00
1 parent b23c235067
commit b182db372a
3 files changed
+13 -12

No files matched your search

+3 -2
View File
@@ -23,7 +23,8 @@ such as https://github.com/google/oss-fuzz calling LLVMFuzzerTestOneInput.
When working on the fuzz implementation, or as a sanity check, defining
WUFFS_CONFIG__FUZZLIB_MAIN will let you manually run fuzz over a set of files:
gcc -DWUFFS_CONFIG__FUZZLIB_MAIN gif.c && ./a.out ../../../test/testdata/*.gif
g++ -DWUFFS_CONFIG__FUZZLIB_MAIN gif.cc
./a.out ../../../test/testdata/*.gif
rm -f ./a.out
It should print "PASS", amongst other information, and exit(0).
@@ -35,7 +36,7 @@ It should print "PASS", amongst other information, and exit(0).
// relative includes, you can use the script/inline-c-relative-includes.go
// program to generate a stand-alone C file.
#include "../../../gen/c/std/gif.c"
#include "../fuzzlib/fuzzlib.c"
#include "../fuzzlib/fuzzlib.cc"
void fuzz(wuffs_base__reader1 src_reader, uint32_t hash) {
void* pixbuf = NULL;
+3 -2
View File
@@ -23,7 +23,8 @@ such as https://github.com/google/oss-fuzz calling LLVMFuzzerTestOneInput.
When working on the fuzz implementation, or as a sanity check, defining
WUFFS_CONFIG__FUZZLIB_MAIN will let you manually run fuzz over a set of files:
gcc -DWUFFS_CONFIG__FUZZLIB_MAIN zlib.c && ./a.out ../../../test/testdata/*.zlib
g++ -DWUFFS_CONFIG__FUZZLIB_MAIN zlib.cc
./a.out ../../../test/testdata/*.zlib
rm -f ./a.out
It should print "PASS", amongst other information, and exit(0).
@@ -36,7 +37,7 @@ It should print "PASS", amongst other information, and exit(0).
// program to generate a stand-alone C file.
#include "../../../gen/c/std/deflate.c"
#include "../../../gen/c/std/zlib.c"
#include "../fuzzlib/fuzzlib.c"
#include "../fuzzlib/fuzzlib.cc"
void fuzz(wuffs_base__reader1 src_reader, uint32_t hash) {
wuffs_zlib__status s;