[lldb] Fix -Wformat warning in debugserver unit test
authorJonas Devlieghere <jonas@devlieghere.com>
Wed, 9 Dec 2020 03:30:10 +0000 (19:30 -0800)
committerJonas Devlieghere <jonas@devlieghere.com>
Wed, 9 Dec 2020 04:57:51 +0000 (20:57 -0800)
RNBSocketTest.cpp:31:35: warning: format specifies type 'char *' but the
argument has type 'const void *' [-Wformat]

lldb/unittests/debugserver/RNBSocketTest.cpp

index 7840c48..2625a6d 100644 (file)
@@ -28,7 +28,7 @@ static void ServerCallbackv4(const void *baton, in_port_t port) {
   auto child_pid = fork();
   if (child_pid == 0) {
     char addr_buffer[256];
-    sprintf(addr_buffer, "%s:%d", baton, port);
+    sprintf(addr_buffer, "%s:%d", (const char *)baton, port);
     llvm::Expected<std::unique_ptr<Socket>> socket_or_err =
         Socket::TcpConnect(addr_buffer, false);
     ASSERT_THAT_EXPECTED(socket_or_err, llvm::Succeeded());