hintonda created this revision.

Quash several warnings of this type using clang's suggested fix:

[2741/3631] Building CXX object 
tools/lldb/source/Plugins/Process/gdb-remote/CMakeFiles/lldbPluginProcessGDBRemote.dir/GDBRemoteCommunication.cpp.o
/Users/dhinton/projects/llvm_project/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp:603:7:
 warning: comparison of function 'compression_decode_buffer' not equal to a 
null pointer is always true [-Wtautological-pointer-compare]

  if (compression_decode_buffer != NULL &&
      ^~~~~~~~~~~~~~~~~~~~~~~~~    ~~~~

/Users/dhinton/projects/llvm_project/llvm/tools/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp:603:7:
 note: prefix with the address-of operator to silence this warning

  if (compression_decode_buffer != NULL &&
      ^
      &


https://reviews.llvm.org/D39580

Files:
  source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
  source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp


Index: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
===================================================================
--- source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -1024,7 +1024,7 @@
 #if defined(HAVE_LIBCOMPRESSION)
   // libcompression is weak linked so test if compression_decode_buffer() is
   // available
-  if (compression_decode_buffer != NULL &&
+  if (&compression_decode_buffer != NULL &&
       avail_type == CompressionType::None) {
     for (auto compression : supported_compressions) {
       if (compression == "lzfse") {
@@ -1039,7 +1039,7 @@
 #if defined(HAVE_LIBCOMPRESSION)
   // libcompression is weak linked so test if compression_decode_buffer() is
   // available
-  if (compression_decode_buffer != NULL &&
+  if (&compression_decode_buffer != NULL &&
       avail_type == CompressionType::None) {
     for (auto compression : supported_compressions) {
       if (compression == "zlib-deflate") {
@@ -1066,7 +1066,7 @@
 #if defined(HAVE_LIBCOMPRESSION)
   // libcompression is weak linked so test if compression_decode_buffer() is
   // available
-  if (compression_decode_buffer != NULL &&
+  if (&compression_decode_buffer != NULL &&
       avail_type == CompressionType::None) {
     for (auto compression : supported_compressions) {
       if (compression == "lz4") {
@@ -1081,7 +1081,7 @@
 #if defined(HAVE_LIBCOMPRESSION)
   // libcompression is weak linked so test if compression_decode_buffer() is
   // available
-  if (compression_decode_buffer != NULL &&
+  if (&compression_decode_buffer != NULL &&
       avail_type == CompressionType::None) {
     for (auto compression : supported_compressions) {
       if (compression == "lzma") {
Index: source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
===================================================================
--- source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
+++ source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
@@ -600,7 +600,7 @@
 #if defined(HAVE_LIBCOMPRESSION)
   // libcompression is weak linked so check that compression_decode_buffer() is
   // available
-  if (compression_decode_buffer != NULL &&
+  if (&compression_decode_buffer != NULL &&
       (m_compression_type == CompressionType::ZlibDeflate ||
        m_compression_type == CompressionType::LZFSE ||
        m_compression_type == CompressionType::LZ4)) {


Index: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
===================================================================
--- source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -1024,7 +1024,7 @@
 #if defined(HAVE_LIBCOMPRESSION)
   // libcompression is weak linked so test if compression_decode_buffer() is
   // available
-  if (compression_decode_buffer != NULL &&
+  if (&compression_decode_buffer != NULL &&
       avail_type == CompressionType::None) {
     for (auto compression : supported_compressions) {
       if (compression == "lzfse") {
@@ -1039,7 +1039,7 @@
 #if defined(HAVE_LIBCOMPRESSION)
   // libcompression is weak linked so test if compression_decode_buffer() is
   // available
-  if (compression_decode_buffer != NULL &&
+  if (&compression_decode_buffer != NULL &&
       avail_type == CompressionType::None) {
     for (auto compression : supported_compressions) {
       if (compression == "zlib-deflate") {
@@ -1066,7 +1066,7 @@
 #if defined(HAVE_LIBCOMPRESSION)
   // libcompression is weak linked so test if compression_decode_buffer() is
   // available
-  if (compression_decode_buffer != NULL &&
+  if (&compression_decode_buffer != NULL &&
       avail_type == CompressionType::None) {
     for (auto compression : supported_compressions) {
       if (compression == "lz4") {
@@ -1081,7 +1081,7 @@
 #if defined(HAVE_LIBCOMPRESSION)
   // libcompression is weak linked so test if compression_decode_buffer() is
   // available
-  if (compression_decode_buffer != NULL &&
+  if (&compression_decode_buffer != NULL &&
       avail_type == CompressionType::None) {
     for (auto compression : supported_compressions) {
       if (compression == "lzma") {
Index: source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
===================================================================
--- source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
+++ source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
@@ -600,7 +600,7 @@
 #if defined(HAVE_LIBCOMPRESSION)
   // libcompression is weak linked so check that compression_decode_buffer() is
   // available
-  if (compression_decode_buffer != NULL &&
+  if (&compression_decode_buffer != NULL &&
       (m_compression_type == CompressionType::ZlibDeflate ||
        m_compression_type == CompressionType::LZFSE ||
        m_compression_type == CompressionType::LZ4)) {
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to