Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
runs-on: ${{ matrix.platform }}
container: ${{ matrix.container }}
env:
CMAKE_DEFINES: "${{ matrix.CMAKE_DEFINES }}"
CMAKE_DEFINES: "-DCMAKE_COMPILE_WARNING_AS_ERROR=ON ${{ matrix.CMAKE_DEFINES }}"
steps:
- name: Installing Alpine Linux Dependencies
if: ${{ contains(matrix.container, 'alpine') }}
Expand Down
15 changes: 10 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ if(MSVC)
target_compile_options(crashpad_interface INTERFACE
$<$<COMPILE_LANGUAGE:C,CXX>:/FS>
$<$<COMPILE_LANGUAGE:C,CXX>:/W4>
$<$<COMPILE_LANGUAGE:C,CXX>:/WX>
$<$<COMPILE_LANGUAGE:C,CXX>:/bigobj> # Support larger number of sections in obj file.
$<$<COMPILE_LANGUAGE:C,CXX>:/wd4100> # Unreferenced formal parameter.
$<$<COMPILE_LANGUAGE:C,CXX>:/wd4127> # Conditional expression is constant.
Expand All @@ -134,10 +133,15 @@ if(MSVC)
$<$<AND:$<COMPILE_LANGUAGE:C,CXX>,$<C_COMPILER_ID:Clang>>:-Wno-cast-function-type-mismatch> # only Clang-CL
$<$<AND:$<COMPILE_LANGUAGE:C,CXX>,$<C_COMPILER_ID:Clang>>:-Wno-return-type>
)
elseif(MINGW)
# redirect to wmain
# FIXME: cmake 3.13 added target_link_options
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -municode")
else()
# precede per-target -Wno-* flags, which clang applies in order
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
if(MINGW)
# redirect to wmain
# FIXME: cmake 3.13 added target_link_options
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -municode")
endif()
endif()

if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
Expand Down Expand Up @@ -183,6 +187,7 @@ add_subdirectory(handler)
if(CRASHPAD_ENABLE_STACKTRACE AND APPLE AND NOT IOS)
set(LIBUNWIND_ENABLE_SHARED OFF)
add_subdirectory(libunwind)
set_property(TARGET unwind_static PROPERTY COMPILE_WARNING_AS_ERROR OFF)
crashpad_install_target(unwind_static)
endif()

Expand Down
5 changes: 3 additions & 2 deletions client/crashpad_client_linux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -596,9 +596,10 @@ bool CrashpadClient::InitializeSignalStackForThread() {
#endif // ADDRESS_SANITIZER
const size_t kStackAllocSize = kStackSize + 2 * kGuardPageSize;

stack_t disabled;
disabled.ss_flags = SS_DISABLE;
stack_t stack;
stack.ss_flags = SS_DISABLE;
if (sigaltstack(&stack, &stack) != 0) {
if (sigaltstack(&disabled, &stack) != 0) {
PLOG(ERROR) << "sigaltstack";
} else if (stack.ss_sp !=
static_cast<char*>(stack_mem) + kGuardPageSize) {
Expand Down
4 changes: 4 additions & 0 deletions client/crashpad_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,12 @@ __attribute__((

// Put the struct in a section name CPADinfo where it can be found without the
// symbol table.
#if defined(COMPILER_MSVC)
#pragma section("CPADinfo", read, write)
__declspec(allocate("CPADinfo"))
#else
__attribute__((section("CPADinfo")))
#endif

#else // !BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_WIN)
#error Port
Expand Down
2 changes: 1 addition & 1 deletion client/settings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ bool SettingsReader::ReadSettings(FileHandle handle,
// This clears `out_data` so that any bytes not read from disk are zero
// initialized. This is expected when reading from an older settings file with
// fewer fields.
memset(out_data, 0, sizeof(*out_data));
memset(static_cast<void*>(out_data), 0, sizeof(*out_data));

const FileOperationResult read_result =
log_read_error ? LoggingReadFileUntil(handle, out_data, sizeof(*out_data))
Expand Down
4 changes: 2 additions & 2 deletions snapshot/mac/process_reader_mac.cc
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ ProcessReaderMac::Module::Module() : name(), reader(nullptr), timestamp(0) {}
ProcessReaderMac::Module::~Module() {}

ProcessReaderMac::ProcessReaderMac()
: process_info_(),
: task_(TASK_NULL),
process_info_(),
threads_(),
modules_(),
module_readers_(),
process_memory_(),
task_(TASK_NULL),
initialized_(),
#if defined(CRASHPAD_MAC_32_BIT_SUPPORT)
is_64_bit_(false),
Expand Down
2 changes: 2 additions & 0 deletions tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ if(CRASHPAD_BUILD_TOOLS)
target_compile_definitions(crashpad_generate_dump PRIVATE
WIN32_LEAN_AND_MEAN
NOMINMAX
_CRT_NONSTDC_NO_WARNINGS
)
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
Expand Down Expand Up @@ -150,6 +151,7 @@ if(CRASHPAD_BUILD_TOOLS)
mac/on_demand_service_tool.mm
)
setup_apple_tool(on_demand_service_tool)
target_compile_options(on_demand_service_tool PRIVATE -fobjc-arc)
target_link_libraries(on_demand_service_tool PRIVATE
"-framework CoreFoundation"
"-framework Foundation"
Expand Down
2 changes: 1 addition & 1 deletion util/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ if(WIN32)
$<$<COMPILE_LANGUAGE:CXX>:-municode>
)
target_compile_definitions(crashpad_util PRIVATE
"__STDC_VERSION__=199901L"
$<$<COMPILE_LANGUAGE:CXX>:__STDC_VERSION__=199901L>
$<$<COMPILE_LANGUAGE:ASM_MASM>:__MINGW32__>
)
#exception_handler_server.cc missing <memory> header ?
Expand Down
6 changes: 4 additions & 2 deletions util/stream/zlib_output_stream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ ZlibOutputStream::~ZlibOutputStream() {
return;
DCHECK(!flush_needed_);
if (mode_ == Mode::kCompress) {
if (deflateEnd(&zlib_stream_) != Z_OK)
if (deflateEnd(&zlib_stream_) != Z_OK) {
LOG(ERROR) << "deflateEnd: " << zlib_stream_.msg;
}
} else if (mode_ == Mode::kDecompress) {
if (inflateEnd(&zlib_stream_) != Z_OK)
if (inflateEnd(&zlib_stream_) != Z_OK) {
LOG(ERROR) << "inflateEnd: " << zlib_stream_.msg;
}
}
}

Expand Down
Loading