summaryrefslogtreecommitdiffstats
path: root/lib/Fuzzer
diff options
context:
space:
mode:
authorDan Liew <dan@su-root.co.uk>2017-07-11 18:27:48 +0000
committerDan Liew <dan@su-root.co.uk>2017-07-11 18:27:48 +0000
commit09b7b2c66cd7a683c4cc81ee0042c041b4d11cc9 (patch)
tree53a45371c4f30c1efa71b0f5713c49e1ab4dc0e0 /lib/Fuzzer
parent9c6fbaca3530f029c617512ace45e62285541d72 (diff)
[LibFuzzer] Fix `-Wpedantic` warning reported by Eric Christopher.
The warning is reproducible with GCC 4.8. Thanks to David Blaikie for the suggested fix. The reported warning was ``` /usr/local/google/home/echristo/sources/llvm/lib/Fuzzer/FuzzerExtFunctions.def:29:10: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic] EXT_FUNC(__lsan_enable, void, (), false); ^ /usr/local/google/home/echristo/sources/llvm/lib/Fuzzer/FuzzerExtFunctionsWeak.cpp:44:24: note: in definition of macro ‘EXT_FUNC’ CheckFnPtr((void *)::NAME, #NAME, WARN); ^ ``` Differential Revision: https://reviews.llvm.org/D35243 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307686 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Fuzzer')
-rw-r--r--lib/Fuzzer/FuzzerExtFunctionsWeak.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Fuzzer/FuzzerExtFunctionsWeak.cpp b/lib/Fuzzer/FuzzerExtFunctionsWeak.cpp
index 7b02b6f0b701..503f0395cf8f 100644
--- a/lib/Fuzzer/FuzzerExtFunctionsWeak.cpp
+++ b/lib/Fuzzer/FuzzerExtFunctionsWeak.cpp
@@ -41,7 +41,8 @@ namespace fuzzer {
ExternalFunctions::ExternalFunctions() {
#define EXT_FUNC(NAME, RETURN_TYPE, FUNC_SIG, WARN) \
this->NAME = ::NAME; \
- CheckFnPtr((void *)::NAME, #NAME, WARN);
+ CheckFnPtr(reinterpret_cast<void *>(reinterpret_cast<uintptr_t>(::NAME)), \
+ #NAME, WARN);
#include "FuzzerExtFunctions.def"