SBCommunication: Fix a pointer-to-function to void-pointer cast
authorDavid Majnemer <david.majnemer@gmail.com>
Tue, 22 Jul 2014 22:12:58 +0000 (22:12 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Tue, 22 Jul 2014 22:12:58 +0000 (22:12 +0000)
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.

llvm-svn: 213696

lldb/source/API/SBCommunication.cpp

index a29f735..df0b864 100644 (file)
@@ -250,7 +250,7 @@ SBCommunication::SetReadThreadBytesReceivedCallback
     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;