[Lldb-commits] [lldb] r213692 - SBHostOS: Fix a pointer-to-function to void-pointer cast

David Majnemer david.majnemer at gmail.com
Tue Jul 22 15:00:04 PDT 2014


Author: majnemer
Date: Tue Jul 22 17:00:04 2014
New Revision: 213692

URL: http://llvm.org/viewvc/llvm-project?rev=213692&view=rev
Log:
SBHostOS: Fix a pointer-to-function to void-pointer cast

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 fixes a warning emitted by GCC.

Differential Revision: http://reviews.llvm.org/D4624

Modified:
    lldb/trunk/source/API/SBHostOS.cpp

Modified: lldb/trunk/source/API/SBHostOS.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBHostOS.cpp?rev=213692&r1=213691&r2=213692&view=diff
==============================================================================
--- lldb/trunk/source/API/SBHostOS.cpp (original)
+++ lldb/trunk/source/API/SBHostOS.cpp Tue Jul 22 17:00:04 2014
@@ -51,7 +51,7 @@ SBHostOS::ThreadCreate
 
     if (log)
         log->Printf ("SBHostOS::ThreadCreate (name=\"%s\", thread_function=%p, thread_arg=%p, error_ptr=%p)",
-                     name, reinterpret_cast<void*>(thread_function),
+                     name, reinterpret_cast<void*>(reinterpret_cast<intptr_t>(thread_function)),
                      static_cast<void*>(thread_arg),
                      static_cast<void*>(error_ptr));
 





More information about the lldb-commits mailing list