[Lldb-commits] [lldb] r213696 - SBCommunication: Fix a pointer-to-function to void-pointer cast

David Majnemer david.majnemer at gmail.com
Tue Jul 22 15:12:58 PDT 2014


Author: majnemer
Date: Tue Jul 22 17:12:58 2014
New Revision: 213696

URL: http://llvm.org/viewvc/llvm-project?rev=213696&view=rev
Log:
SBCommunication: 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 diagnostic emitted by GCC.

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

Modified: lldb/trunk/source/API/SBCommunication.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBCommunication.cpp?rev=213696&r1=213695&r2=213696&view=diff
==============================================================================
--- lldb/trunk/source/API/SBCommunication.cpp (original)
+++ lldb/trunk/source/API/SBCommunication.cpp Tue Jul 22 17:12:58 2014
@@ -250,7 +250,7 @@ SBCommunication::SetReadThreadBytesRecei
     if (log)
         log->Printf ("SBCommunication(%p)::SetReadThreadBytesReceivedCallback (callback=%p, baton=%p) => %i",
                      static_cast<void*>(m_opaque),
-                     reinterpret_cast<void*>(callback),
+                     reinterpret_cast<void*>(reinterpret_cast<intptr_t>(callback)),
                      static_cast<void*>(callback_baton), result);
 
     return result;





More information about the lldb-commits mailing list