[Lldb-commits] [lldb] r287848 - Fix a comparison of integers of different signs warning.

Taras Tsugrii via lldb-commits lldb-commits at lists.llvm.org
Wed Nov 23 17:34:43 PST 2016


Author: ttsugrii
Date: Wed Nov 23 19:34:43 2016
New Revision: 287848

URL: http://llvm.org/viewvc/llvm-project?rev=287848&view=rev
Log:
Fix a comparison of integers of different signs warning.

  source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp:403:21: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
  for (int i = 0; i < llvm::array_lengthof (magicks); i++)
                  ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Differential Revision: https://reviews.llvm.org/D27081


Modified:
    lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp

Modified: lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp?rev=287848&r1=287847&r2=287848&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp Wed Nov 23 19:34:43 2016
@@ -400,7 +400,7 @@ DynamicLoaderDarwinKernel::CheckForKerne
   const uint32_t magicks[] = { llvm::MachO::MH_MAGIC_64, llvm::MachO::MH_MAGIC, llvm::MachO::MH_CIGAM, llvm::MachO::MH_CIGAM_64};
 
   bool found_matching_pattern = false;
-  for (int i = 0; i < llvm::array_lengthof (magicks); i++)
+  for (size_t i = 0; i < llvm::array_lengthof (magicks); i++)
     if (::memcmp (magicbuf, &magicks[i], sizeof (magicbuf)) == 0)
         found_matching_pattern = true;
 




More information about the lldb-commits mailing list