[llvm-branch-commits] [lldb] c59ccc0 - [lldb] Fix -Wformat warning in debugserver unit test

Jonas Devlieghere via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Dec 8 21:02:18 PST 2020


Author: Jonas Devlieghere
Date: 2020-12-08T20:57:51-08:00
New Revision: c59ccc022265a6a3d70c86c4cf6391ebd70e6497

URL: https://github.com/llvm/llvm-project/commit/c59ccc022265a6a3d70c86c4cf6391ebd70e6497
DIFF: https://github.com/llvm/llvm-project/commit/c59ccc022265a6a3d70c86c4cf6391ebd70e6497.diff

LOG: [lldb] Fix -Wformat warning in debugserver unit test

RNBSocketTest.cpp:31:35: warning: format specifies type 'char *' but the
argument has type 'const void *' [-Wformat]

Added: 
    

Modified: 
    lldb/unittests/debugserver/RNBSocketTest.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/unittests/debugserver/RNBSocketTest.cpp b/lldb/unittests/debugserver/RNBSocketTest.cpp
index 7840c48f82b4..2625a6d36b5c 100644
--- a/lldb/unittests/debugserver/RNBSocketTest.cpp
+++ b/lldb/unittests/debugserver/RNBSocketTest.cpp
@@ -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());


        


More information about the llvm-branch-commits mailing list