Fix building the repo with Android NDK R29#121194
Merged
MichalStrehovsky merged 2 commits intodotnet:mainfrom Oct 30, 2025
Merged
Fix building the repo with Android NDK R29#121194MichalStrehovsky merged 2 commits intodotnet:mainfrom
MichalStrehovsky merged 2 commits intodotnet:mainfrom
Conversation
Drive-by fix while I'm looking at dotnet#121172. ``` D:/git/runtime1/src/native/libs/System.Security.Cryptography.Native.Android/pal_ecc_import_export.c:444:59: error: format specifies type 'int' but the argument has underlying type 'unsigned int' [-Werror,-Wformat] 444 | LOG_ERROR("Unuspported curve type specified: %d", curveType); | ~~ ^~~~~~~~~ | %u D:/git/runtime1/src/native/libs/System.Native/pal_ifaddrs.c:460:46: error: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'ssize_t' (aka 'long') [-Werror,-Wformat] 460 | LOG_DEBUG(" address data length: %zu", length); | ~~~ ^~~~~~ | %zd ```
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR corrects printf format specifiers in log statements to match their corresponding argument types, improving type safety and preventing potential undefined behavior or incorrect output.
- Changed format specifier from
%zuto%zdforssize_tvariable - Changed format specifier from
%dto%uforECCurveTypeenum variable
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/native/libs/System.Security.Cryptography.Native.Android/pal_ecc_import_export.c | Updated format specifier for curveType enum parameter to use %u instead of %d |
| src/native/libs/System.Native/pal_ifaddrs.c | Updated format specifier for length variable to use %zd instead of %zu |
src/native/libs/System.Security.Cryptography.Native.Android/pal_ecc_import_export.c
Outdated
Show resolved
Hide resolved
…l_ecc_import_export.c Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Open
3 tasks
bartonjs
approved these changes
Oct 30, 2025
Member
Author
|
/ba-g uninteresting leg infrastructure timeouts |
This was referenced Oct 31, 2025
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Drive-by fix while I'm looking at #121172.
Cc @dotnet/ncl @dotnet/area-system-security