Skip to content

Commit

Permalink
Bug 666646 - Fix warnings in toolkit/crashreporter and suppress MSVC …
Browse files Browse the repository at this point in the history
…warning in third-party Breakpad code. r=ted
  • Loading branch information
cpeterso committed May 15, 2014
1 parent d33deae commit 9e062b4
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ int __breakpad_fdnlist(int fd, nlist_type *list, const char **symbolNames,

off_t sa; /* symbol address */
off_t ss; /* start of strings */
register register_t n;
register_t n;
if (*((unsigned int *)&buf) == magic) {
if (lseek(fd, arch_offset, SEEK_SET) == -1) {
return -1;
Expand Down Expand Up @@ -354,7 +354,7 @@ int __breakpad_fdnlist(int fd, nlist_type *list, const char **symbolNames,
// and look for a match
while (n) {
nlist_type space[BUFSIZ/sizeof (nlist_type)];
register register_t m = sizeof (space);
register_t m = sizeof (space);

if (n < m)
m = n;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ class DwarfCUToModule: public dwarf2reader::RootDIEHandler {

// Used internally by the handler. Full definitions are in
// dwarf_cu_to_module.cc.
struct FilePrivate;
struct Specification;
struct CUContext;
struct DIEContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,8 @@ bool Tokenize(char *line,
}

// If there's anything left, just add it as a single token.
if (!remaining > 0) {
if ((token = strtok_r(NULL, "\r\n", &save_ptr))) {
tokens->push_back(token);
}
if (remaining == 0 && (token = strtok_r(NULL, "\r\n", &save_ptr))) {
tokens->push_back(token);
}

return tokens->size() == static_cast<unsigned int>(max_tokens);
Expand Down
7 changes: 7 additions & 0 deletions toolkit/crashreporter/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,10 @@ LOCAL_INCLUDES += [
'google-breakpad/src',
]

# Suppress warnings in third-party code.
if CONFIG['_MSC_VER']:
CXXFLAGS += [
'-wd4005', # macro redefinition
]

FAIL_ON_WARNINGS = True
2 changes: 1 addition & 1 deletion toolkit/crashreporter/nsExceptionHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ bool MinidumpCallback(
if (eventloopNestingLevel > 0) {
unused << sys_write(fd, kEventLoopNestingLevelParameter, kEventLoopNestingLevelParameterLen);
char buffer[16];
XP_TTOA(eventloopNestingLevel, buffer, 10);
XP_TTOA(static_cast<time_t>(eventloopNestingLevel), buffer, 10);
unused << sys_write(fd, buffer, my_strlen(buffer));
unused << sys_write(fd, "\n", 1);
}
Expand Down

0 comments on commit 9e062b4

Please sign in to comment.