Use (void *)(intptr_t) to cast function addresses to void*

for use with sys::Path::GetMainExecutable, to avoid warnings
with -pedantic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78245 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman
2009-08-05 21:03:39 +00:00
parent 7bfdca0206
commit 8608cf23da
2 changed files with 7 additions and 11 deletions

View File

@@ -415,7 +415,7 @@ static void EmitShellScript(char **argv) {
// build tree to the destination file.
std::string ErrMsg;
sys::Path llvmstub = FindExecutable("llvm-stub.exe", argv[0],
reinterpret_cast<void *>(&Optimize));
(void *)(intptr_t)&Optimize);
if (llvmstub.isEmpty())
PrintAndExit("Could not find llvm-stub.exe executable!");
@@ -642,7 +642,7 @@ int main(int argc, char **argv, char **envp) {
// Determine the locations of the llc and gcc programs.
sys::Path llc = FindExecutable("llc", argv[0],
reinterpret_cast<void *>(&Optimize));
(void *)(intptr_t)&Optimize);
if (llc.isEmpty())
PrintAndExit("Failed to find llc");
@@ -672,7 +672,7 @@ int main(int argc, char **argv, char **envp) {
// Determine the locations of the llc and gcc programs.
sys::Path llc = FindExecutable("llc", argv[0],
reinterpret_cast<void *>(&Optimize));
(void *)(intptr_t)&Optimize);
if (llc.isEmpty())
PrintAndExit("Failed to find llc");