It is a choice based on some reasons:
- i is going to negative here where the loop stops. So i must be signed
- i should be large enough to hold a unsigned size_t. If type int is
sufficient in the previous case, type long is larger.
3.As I know, size_t is unsigned long under OS X.
Although there are still some Wsign-compare warnings outside this patch, I think this diff is good enough for its own purpose.
I am fine with landing it if there is no further issue.
BTW Here are the warnings I faced on Linux:
/home/chilledheart/sources-llvm/llvm_lldb/tools/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp:749:35: warning: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare] if (machine_regno == m_machine_fp_regnum) ~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~ /home/chilledheart/sources-llvm/llvm_lldb/tools/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp:845:53: warning: comparison of integers of different signs: 'int' and 'lldb::addr_t' (aka 'unsigned long') [-Wsign-compare] if (current_func_text_offset + insn_len < m_func_bounds.GetByteSize()) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 warnings generated.