Details
- Reviewers
emaste
Diff Detail
Event Timeline
One small comment but otherwise looks good to me, fwiw.
tools/debugserver/source/RNBRemote.cpp | ||
---|---|---|
2219 | I think 'i' should be size_t to match buf_size, right? That's how you changed the decl in the for loop below. |
It is a choice based on some reasons:
- i is going to negative here where the loop stops. So i must be signed
type.
- 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.
Hi emaste
Sorry for the late coming back. It is still not committed yet.
I am applying this patch against the latest lldb and double-checking it. It won't be long this time.
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.
Those new warnings from UnwindAssembly-x86.cpp are my fault. I'll fix them later today.
I am abandoning this patch and it will be really helpful if someone can follow the latest code of lldb and fix Wsign-compare warnings.
I think 'i' should be size_t to match buf_size, right? That's how you changed the decl in the for loop below.