Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3031)

Issue 488002: Cleaning up google-breakpad source code of signed-unsigned comparison warnings (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 6 months ago by Ivan Penkov
Modified:
11 years, 5 months ago
CC:
google-breakpad-dev_googlegroups.com
Base URL:
http://google-breakpad.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Cleaning up google-breakpad source code of signed-unsigned comparison warnings

Patch Set 1 #

Total comments: 6

Patch Set 2 : Changeing the return type of GetCount to be signed int #

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
M Makefile.am View 1 1 chunk +2 lines, -1 line 0 comments Download
M Makefile.in View 1 2 chunks +3 lines, -2 lines 0 comments Download
M src/client/linux/handler/exception_handler.cc View 1 3 chunks +4 lines, -4 lines 0 comments Download
M src/client/linux/handler/exception_handler_unittest.cc View 1 14 chunks +16 lines, -16 lines 0 comments Download
M src/client/linux/minidump_writer/line_reader_unittest.cc View 1 2 chunks +2 lines, -2 lines 0 comments Download
M src/client/linux/minidump_writer/linux_core_dumper_unittest.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc View 1 2 chunks +3 lines, -2 lines 0 comments Download
M src/client/linux/minidump_writer/minidump_writer.cc View 1 1 chunk +3 lines, -1 line 0 comments Download
M src/client/linux/minidump_writer/minidump_writer_unittest.cc View 1 9 chunks +11 lines, -10 lines 0 comments Download
M src/common/linux/dump_symbols_unittest.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M src/common/linux/elf_core_dump_unittest.cc View 1 3 chunks +3 lines, -3 lines 0 comments Download
M src/common/linux/file_id_unittest.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M src/common/linux/linux_libc_support_unittest.cc View 1 3 chunks +19 lines, -19 lines 0 comments Download
M src/common/linux/memory_mapped_file_unittest.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M src/common/linux/safe_readlink_unittest.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M src/common/linux/synth_elf_unittest.cc View 1 6 chunks +12 lines, -12 lines 0 comments Download
M src/common/memory_range_unittest.cc View 1 5 chunks +6 lines, -6 lines 0 comments Download
M src/processor/basic_source_line_resolver_unittest.cc View 1 2 chunks +7 lines, -7 lines 0 comments Download
M src/processor/binarystream_unittest.cc View 1 18 chunks +20 lines, -20 lines 0 comments Download
M src/processor/disassembler_x86_unittest.cc View 1 5 chunks +38 lines, -38 lines 0 comments Download
M src/processor/fast_source_line_resolver_unittest.cc View 1 2 chunks +7 lines, -7 lines 0 comments Download
M src/processor/minidump_processor_unittest.cc View 1 2 chunks +4 lines, -4 lines 0 comments Download
M src/processor/minidump_stackwalk.cc View 1 2 chunks +2 lines, -2 lines 0 comments Download
M src/processor/minidump_unittest.cc View 1 4 chunks +4 lines, -4 lines 0 comments Download
M src/processor/module_serializer.h View 1 1 chunk +1 line, -1 line 0 comments Download
M src/processor/stackwalker_arm_unittest.cc View 1 4 chunks +6 lines, -6 lines 0 comments Download
M src/processor/static_map.h View 1 1 chunk +1 line, -1 line 0 comments Download
M src/processor/static_range_map.h View 1 1 chunk +1 line, -1 line 0 comments Download
M src/tools/linux/md2core/minidump-2-core.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M src/tools/linux/md2core/minidump_memory_range_unittest.cc View 1 6 chunks +7 lines, -7 lines 0 comments Download

Messages

Total messages: 6
Ivan Penkov
A couple of signed-unsigned comparison warnings were recently introduced in src/client/linux/handler/exception_handler.cc. This is a nuisance ...
11 years, 6 months ago #1
Mark Mentovai
I’m unable to perform reviews for at least the rest of this week. On Mon, ...
11 years, 6 months ago #2
Ted Mielczarek
11 years, 6 months ago #3
Ivan Penkov
On 2012/10/16 13:34:31, Ted Mielczarek wrote: Ted, I don't see any of your comments. Can ...
11 years, 5 months ago #4
Ted Mielczarek
LGTM Sorry, I was just CCing the list last time, and then I forgot to ...
11 years, 5 months ago #5
Ivan Penkov
11 years, 5 months ago #6
Thanks for the comments.  I was able to address one of the concerns.

-Ivan

http://breakpad.appspot.com/488002/diff/1/src/client/linux/minidump_writer/li...
File src/client/linux/minidump_writer/line_reader_unittest.cc (right):

http://breakpad.appspot.com/488002/diff/1/src/client/linux/minidump_writer/li...
src/client/linux/minidump_writer/line_reader_unittest.cc:169:
ASSERT_EQ(static_cast<ssize_t>(sizeof(l)), r);
On 2012/11/20 12:59:56, Ted Mielczarek wrote:
> Can't you just use ssize_t for the type of r above? (That's the actual return
> value of write anyway.)

r is already signed - which is correct.  The problem is that "sizeof" is
unsigned and the comparison generates the warning.  The alternative: using an
unsigned type (like size_t) for r would be plain wrong, because write can return
-1.

http://breakpad.appspot.com/488002/diff/1/src/client/linux/minidump_writer/mi...
File src/client/linux/minidump_writer/minidump_writer_unittest.cc (right):

http://breakpad.appspot.com/488002/diff/1/src/client/linux/minidump_writer/mi...
src/client/linux/minidump_writer/minidump_writer_unittest.cc:384:
ASSERT_EQ(static_cast<ssize_t>(sizeof(junk)), nr);
On 2012/11/20 12:59:56, Ted Mielczarek wrote:
> Similarly here, you could just use ssize_t for the type of nr.

Exact same issue.  Please, check my other response.

http://breakpad.appspot.com/488002/diff/1/src/processor/static_range_map-inl.h
File src/processor/static_range_map-inl.h (right):

http://breakpad.appspot.com/488002/diff/1/src/processor/static_range_map-inl....
src/processor/static_range_map-inl.h:109: if (index >=
static_cast<ssize_t>(GetCount())) {
On 2012/11/20 12:59:56, Ted Mielczarek wrote:
> Should we make the index parameter unsigned?

I actually decided to change GetCount method to return signed int.  This way
StaticRangeMap is consistent with RangeMap.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 1004:630ec63f810e-tainted