Open DonggeLiu opened 2 weeks ago
/gcbrun exp -n dg
/gcbrun exp -f -n dg
@oliverchang @jonathanmetzman Do you happen to know if there is a solution to this error?
This error is caused by including a C file in the C++ fuzz target.
C allows type casting, but C++ does not, hence the error happened on the #include
statement.
The original fuzz target is in C++ and so is the project-under-test (openssl
).
But that specific file vp9_decodeframe.c
is in C:
In file included from /src/libvpx/examples/vpx_dec_fuzzer.cc:28:
/src/libvpx/vp9/decoder/vp9_decodeframe.c:69:11: error: cannot initialize a variable of type 'TX_MODE' with an rvalue of type 'int'
69 | TX_MODE tx_mode = vpx_read_literal(r, 2);
I tried adding extern "C"
around the #include
statement, but it does fix the error:
extern "C" {
#include "/src/libvpx/vp9/decoder/vp9_decodeframe.c"
}
Example:
In the long term, we probably should not be required to include source code files.