diff options
author | Mike Frysinger <vapier@chromium.org> | 2016-01-26 15:38:19 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@chromium.org> | 2016-01-26 15:38:19 -0500 |
commit | bc44efdc274aaf5b3b575d66f7e245754c0fa1e1 (patch) | |
tree | 5215c96d8fa995f3a65f162a0a16c4dc050f1e41 /src/common/mac | |
parent | autotools: regen w/latest versions (diff) | |
download | breakpad-bc44efdc274aaf5b3b575d66f7e245754c0fa1e1.tar.xz |
convert to uint8_t* for binary data to fix -Wnarrowing build errors
Newer gcc versions default to -Werror=narrowing when using newer C++
standards (which we do). This causes issues when we try to stuff a
value like 0xea into a char -- the value is out of range for signed
char bytes. That's when gcc throws an error:
.../bytereader_unittest.cc: In member function 'virtual void Reader_DW_EH_PE_absptr4_Test::TestBody()':
.../bytereader_unittest.cc:400:55: error: narrowing conversion of '234' from 'int' to 'char' inside { } [-Wnarrowing]
BUG=chromium:579384
TEST=`make check` passes
R=mark@chromium.org
Review URL: https://codereview.chromium.org/1605153004 .
Diffstat (limited to 'src/common/mac')
-rw-r--r-- | src/common/mac/dump_syms.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/common/mac/dump_syms.cc b/src/common/mac/dump_syms.cc index 4dcdb73e..b86a7c26 100644 --- a/src/common/mac/dump_syms.cc +++ b/src/common/mac/dump_syms.cc @@ -41,6 +41,7 @@ #include <libgen.h> #include <mach-o/arch.h> #include <mach-o/fat.h> +#include <stdint.h> #include <stdio.h> #include <sys/stat.h> #include <sys/types.h> @@ -316,7 +317,7 @@ class DumpSymbols::DumperLineToModule: compilation_dir_ = compilation_dir; } - void ReadProgram(const char *program, uint64 length, + void ReadProgram(const uint8_t *program, uint64 length, Module *module, vector<Module::Line> *lines) { DwarfLineToModule handler(module, compilation_dir_, lines); dwarf2reader::LineInfo parser(program, length, byte_reader_, &handler); @@ -346,7 +347,7 @@ bool DumpSymbols::ReadDwarf(google_breakpad::Module *module, it != dwarf_sections.end(); ++it) { file_context.AddSectionToSectionMap( it->first, - reinterpret_cast<const char *>(it->second.contents.start), + it->second.contents.start, it->second.contents.Size()); } @@ -354,7 +355,7 @@ bool DumpSymbols::ReadDwarf(google_breakpad::Module *module, dwarf2reader::SectionMap::const_iterator debug_info_entry = file_context.section_map().find("__debug_info"); assert(debug_info_entry != file_context.section_map().end()); - const std::pair<const char*, uint64>& debug_info_section = + const std::pair<const uint8_t *, uint64>& debug_info_section = debug_info_entry->second; // There had better be a __debug_info section! if (!debug_info_section.first) { @@ -424,7 +425,7 @@ bool DumpSymbols::ReadCFI(google_breakpad::Module *module, } // Find the call frame information and its size. - const char *cfi = reinterpret_cast<const char *>(section.contents.start); + const uint8_t *cfi = section.contents.start; size_t cfi_size = section.contents.Size(); // Plug together the parser, handler, and their entourages. |