Repository navigation
Fix iossimulator build with XCode 26.4 - #128893
Merged
Merged
Conversation
It seems that our CI jobs are using XCode 16.4 and the latest version of XCode, 26.4, bumped clang to version 21 which adds some new warnings (`-Wimplicit-int-enum-cast` and `-Wimplicit-void-ptr-cast`). These warnings are picked locally as build errors. This fixes the local build. Build command used locally: ``` ./build.sh -arch arm64 -os iossimulator -s clr+clr.runtime+libs+packs+libs.tests -c Release /p:UseMonoRuntime=false /p:UseNativeAOTRuntime=false /p:EnableAdditionalTimezoneChecks=true /p:EnableAggressiveTrimming=true ```
Contributor
|
Tagging subscribers to this area: @dotnet/area-system-globalization |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes small, targeted Objective-C/C changes in Apple native shims to avoid newer Clang warnings-as-errors by replacing implicit integer/void-pointer conversions with explicit casts, improving iossimulator build compatibility with newer Xcode toolchains.
Changes:
- Add explicit casts when converting
CFArrayGetValueAtIndexresults toCFDictionaryRefin the PKCS#12 import paths. - Add explicit casts for
CompareOptionsand variousNS_*Options/NSCalendarUnitzero/bitmask usages to avoid implicit int→enum conversions. - Keep behavior unchanged while making the intent explicit to the compiler.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/native/libs/System.Security.Cryptography.Native.Apple/pal_x509_ios.c | Explicitly casts CFArrayGetValueAtIndex results to CFDictionaryRef in PKCS#12 parsing paths. |
| src/native/libs/System.Globalization.Native/pal_collation.m | Adds explicit casts for CompareOptions and option-typed 0 arguments to satisfy stricter Clang warnings. |
| src/native/libs/System.Globalization.Native/pal_calendarData.m | Casts NSCalendarUnit bitmask expression to the expected options type for components:fromDate:. |
akoeplinger
approved these changes
Jun 2, 2026
This was referenced Jun 2, 2026
Member
Author
|
/ba-g failures unrelated |
Member
|
/backport to release/10.0 |
Contributor
|
Started backporting to |
2 of 4 tasks
akoeplinger
pushed a commit
that referenced
this pull request
Jun 12, 2026
Backport of #128893 to release/10.0 /cc @akoeplinger @BrzVlad ## Customer Impact - [ ] Customer reported - [x] Found internally Necessary to build runtime repo for iOS Simulator with newer versions of Xcode. ## Regression - [ ] Yes - [x] No ## Testing CI testing. ## Risk Low, this just adds a couple casts. Co-authored-by: Vlad Brezae <[email protected]>
eiriktsarpalis
pushed a commit
that referenced
this pull request
Jul 15, 2026
It seems that our CI jobs are using XCode 16.4 and the latest version of XCode, 26.4, bumped clang to version 21 which adds some new warnings (`-Wimplicit-int-enum-cast` and `-Wimplicit-void-ptr-cast`). These warnings are picked locally as build errors. This fixes the local build by adding some explicit casting. Build command used locally: ``` ./build.sh -arch arm64 -os iossimulator -s clr+clr.runtime+libs+packs+libs.tests -c Release /p:UseMonoRuntime=false /p:UseNativeAOTRuntime=false /p:EnableAdditionalTimezoneChecks=true /p:EnableAggressiveTrimming=true ```
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.
It seems that our CI jobs are using XCode 16.4 and the latest version of XCode, 26.4, bumped clang to version 21 which adds some new warnings (
-Wimplicit-int-enum-castand-Wimplicit-void-ptr-cast). These warnings are picked locally as build errors. This fixes the local build by adding some explicit casting.Build command used locally: