Repository navigation
ci: treat warnings as errors - #181
Merged
Merged
Conversation
jpnurmi
force-pushed
the
jpnurmi/ci/error-on-warnings
branch
from
November 18, 2026 15:48
444b190 to
8cb025c
Compare
jpnurmi
force-pushed
the
jpnurmi/ci/error-on-warnings
branch
from
November 20, 2026 09:14
8cb025c to
817cfb8
Compare
Stop forcing `/WX` on users who build crashpad, so that new compiler warnings do not break their builds. CI enables `CMAKE_COMPILE_WARNING_AS_ERROR` instead to keep the code free of warnings. Build with `-Wall` on non-MSVC compilers to match `/W4` on MSVC.
- `-Wdangling-else` in `ZlibOutputStream` - `-Wrestrict` from passing the same `stack_t` to `sigaltstack()` - `-Wclass-memaccess` from clearing `SettingsReader::Data` - `-Wreorder-ctor` in `ProcessReaderMac` - ARC bridging casts in `on_demand_service_tool` - deprecated `unlink()` in `crashpad_generate_dump` with clang-cl
MinGW ignores `#pragma section` and `__declspec(allocate)`, so the handler could not find `CrashpadInfo` and ignored its settings, such as `limit_stack_capture_to_sp`. Use the GNU `section` attribute instead.
jpnurmi
force-pushed
the
jpnurmi/ci/error-on-warnings
branch
from
November 20, 2026 09:39
817cfb8 to
ce3b331
Compare
The arm64 assembly is preprocessed as C, where the definition
redefines a builtin macro:
<command line>:11:9: error: redefining builtin macro [-Werror,-Wbuiltin-macro-redefined]
Ref: https://github.com/getsentry/crashpad/actions/runs/44712564858/job/136207676046
JoshuaMoelans
approved these changes
Nov 20, 2026
jpnurmi
added a commit
to getsentry/sentry-native
that referenced
this pull request
Nov 20, 2026
Bump to the merge commits of getsentry/breakpad#47 and getsentry/crashpad#181.
jpnurmi
added a commit
to getsentry/sentry-native
that referenced
this pull request
Nov 23, 2026
#2315) * build: apply `SENTRY_ERROR_ON_WARNINGS` to breakpad and crashpad Build breakpad with `/W3` on MSVC and `-Wall` elsewhere, and treat breakpad's and crashpad's warnings as errors with `SENTRY_ERROR_ON_WARNINGS`. Bump breakpad and crashpad to fix their warnings. * build: respect `SENTRY_ERROR_ON_WARNINGS` on MSVC Add `/WX` to sentry, crashpad and breakpad when the option is enabled, like `-Werror` on other compilers. * build: suppress the warnings new in clang-cl 21 clang-cl maps `-Wall` to `-Weverything`, so the warnings that clang 21 added fail the `sentry` build with the clang-cl 22.1.3 that ships with Visual Studio 2026. ```text include\sentry.h(955,11): error: identifier 'wchar_t' conflicts with a C++ keyword [-Werror,-Wc++-keyword] src\sentry_attachment.c(233,12): error: not eliding copy on return [-Werror,-Wnrvo] src\backends\sentry_backend_inproc.c(147,31): error: padding struct 'struct sentry_inproc_backend_config_s' with 3 bytes to align 'handler_strategy' [-Werror,-Wpadded] ``` * build: bump breakpad and crashpad to the merged warning fixes Bump to the merge commits of getsentry/breakpad#47 and getsentry/crashpad#181. * build: copy the sentry warning options to sentry-crash on MSVC `sentry-crash` copied the warning options from `sentry` only on GCC and Clang, so `SENTRY_ERROR_ON_WARNINGS` did not reach the daemon on MSVC. Ref: #2315 (comment) * ci: add a ClangCL job for VS 2026 Run the ClangCL build and tests on `windows-2025-vs2026` as well, which ships a newer clang-cl than VS 2022. Let CMake pick the installed Visual Studio instead of forcing the VS 2022 generator. * build: respect `SENTRY_ERROR_ON_WARNINGS` on clang-cl clang-cl always built `sentry` with `-Werror`, so each new clang-cl warning broke the build for everyone. Leave it to the `/WX` that `SENTRY_ERROR_ON_WARNINGS` adds.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stop forcing
/WXon users who include crashpad in their builds, so that new compiler warnings do not break their builds. CI enablesCMAKE_COMPILE_WARNING_AS_ERRORinstead to keep the code free of warnings.Build with
-Wallon non-MSVC compilers to match/W4on MSVC, and fix the resulting warnings:GCC:
macOS:
clang-cl:
MinGW:
MinGW arm64 (
util/misc/capture_context_win_arm64.S):The vendored libunwind in the macOS stack-trace build is excluded from warnings as errors: