diff options
author | Chris Lattner <sabre@nondot.org> | 2006-06-01 17:12:14 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-06-01 17:12:14 +0000 |
commit | fea34a1f1137bfd68417158a91d2cd8b3e19abcb (patch) | |
tree | 35c45ab36c4ff395b16589445a53ff10b6371332 /lib/ExecutionEngine/JIT/Intercept.cpp | |
parent | 484fc8e38421f5b26593a9edacd734baf844c9e9 (diff) |
Silence some -pedantic warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28629 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/JIT/Intercept.cpp')
-rw-r--r-- | lib/ExecutionEngine/JIT/Intercept.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/ExecutionEngine/JIT/Intercept.cpp b/lib/ExecutionEngine/JIT/Intercept.cpp index 105514df3d..490861d66c 100644 --- a/lib/ExecutionEngine/JIT/Intercept.cpp +++ b/lib/ExecutionEngine/JIT/Intercept.cpp @@ -90,13 +90,15 @@ static int jit_atexit(void (*Fn)(void)) { /// for resolving library symbols, not code generated symbols. /// void *JIT::getPointerToNamedFunction(const std::string &Name) { - // Check to see if this is one of the functions we want to intercept... - if (Name == "exit") return (void*)&jit_exit; - if (Name == "atexit") return (void*)&jit_atexit; + // Check to see if this is one of the functions we want to intercept. Note, + // we cast to intptr_t here to silence a -pedantic warning that complains + // about casting a function pointer to a normal pointer. + if (Name == "exit") return (void*)(intptr_t)&jit_exit; + if (Name == "atexit") return (void*)(intptr_t)&jit_atexit; // If the program does not have a linked in __main function, allow it to run, // but print a warning. - if (Name == "__main") return (void*)&__mainFunc; + if (Name == "__main") return (void*)(intptr_t)&__mainFunc; // If it's an external function, look it up in the process image... void *Ptr = sys::DynamicLibrary::SearchForAddressOfSymbol(Name); |