Hi zturner, tfiala,

reinterpret_cast may not convert a pointer-to-function to a
void-pointer.  Take a detour through intptr_t and *then* convert to a
pointer-to-function.

This silences a warning emitted by GCC when building LLDB.

http://reviews.llvm.org/D4631

Files:
  source/Host/common/Host.cpp

Index: source/Host/common/Host.cpp
===================================================================
--- source/Host/common/Host.cpp
+++ source/Host/common/Host.cpp
@@ -1057,7 +1057,8 @@
             static ConstString g_lldb_so_dir;
             if (!g_lldb_so_dir)
             {
-                FileSpec lldb_file_spec (Host::GetModuleFileSpecForHostAddress 
((void *)Host::GetLLDBPath));
+                FileSpec lldb_file_spec(Host::GetModuleFileSpecForHostAddress(
+                    reinterpret_cast<void 
*>(reinterpret_cast<intptr_t>(Host::GetLLDBPath))));
                 g_lldb_so_dir = lldb_file_spec.GetDirectory();
                 if (log)
                     log->Printf("Host::GetLLDBPath(ePathTypeLLDBShlibDir) => 
'%s'", g_lldb_so_dir.GetCString());
Index: source/Host/common/Host.cpp
===================================================================
--- source/Host/common/Host.cpp
+++ source/Host/common/Host.cpp
@@ -1057,7 +1057,8 @@
             static ConstString g_lldb_so_dir;
             if (!g_lldb_so_dir)
             {
-                FileSpec lldb_file_spec (Host::GetModuleFileSpecForHostAddress ((void *)Host::GetLLDBPath));
+                FileSpec lldb_file_spec(Host::GetModuleFileSpecForHostAddress(
+                    reinterpret_cast<void *>(reinterpret_cast<intptr_t>(Host::GetLLDBPath))));
                 g_lldb_so_dir = lldb_file_spec.GetDirectory();
                 if (log)
                     log->Printf("Host::GetLLDBPath(ePathTypeLLDBShlibDir) => '%s'", g_lldb_so_dir.GetCString());
_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits

Reply via email to