Skip to content

fix: resolve compilation warnings - #47

Merged
jpnurmi merged 2 commits into
handlerfrom
jpnurmi/fix/warnings
Nov 20, 2026
Merged

jpnurmi merged 2 commits into
handlerfrom
jpnurmi/fix/warnings

Conversation

@jpnurmi

@jpnurmi jpnurmi commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

Fix the warnings that sentry-native reports when it builds breakpad with -Wall (getsentry/sentry-native#2315):

GCC 12+:

src/common/string_conversion.cc:107:16: error: array subscript 2 is outside array bounds of ‘wchar_t [1]’ [-Werror=array-bounds=]

macOS:

src/client/mac/handler/minidump_generator.cc:606:25: error: unused variable 'machine_state' [-Werror,-Wunused-variable]

MinGW:

src/client/windows/handler/exception_handler.h:63:9: error: unknown pragma ignored [-Werror,-Wunknown-pragmas]
src/client/windows/handler/exception_handler.h:65:9: error: unknown pragma ignored [-Werror,-Wunknown-pragmas]
src/client/windows/handler/exception_handler.h:523:9: error: unknown pragma ignored [-Werror,-Wunknown-pragmas]

`UTF32` is `unsigned long`, so reading the 4-byte `wchar_t` through
a `UTF32` pointer reads 8 bytes on 64-bit Linux and macOS:

    src/common/string_conversion.cc:107:16: error: array subscript 2 is outside array bounds of 'wchar_t [1]' [-Werror=array-bounds=]

Convert the character into a `UTF32` local instead.
- unknown `#pragma warning` in the Windows `exception_handler.h` with MinGW
- unused `machine_state` in `MinidumpGenerator::WriteContextARM64()` on macOS
@jpnurmi
jpnurmi merged commit 881d74b into handler Nov 20, 2026
9 checks passed
@jpnurmi
jpnurmi deleted the jpnurmi/fix/warnings branch November 20, 2026 12:45
jpnurmi added a commit to getsentry/sentry-native that referenced this pull request Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants