Skip to content

Conversation

keith
Copy link
Member

@keith keith commented Jun 15, 2023

With Swift 5.9 our uses of the index C APIs warned with:

.../Sources/IndexStore/IndexStore.swift:299:66: warning: forming 'UnsafeMutableRawPointer' to a variable of type '(SymbolOccurrence, (Symbol, SymbolRoles) -> ())'; this is likely incorrect because '(SymbolOccurrence, (Symbol, SymbolRoles) -> ())' may contain an object reference.

This solution is referenced in the swift-evolution proposal's common
workarounds: https://github.com/atrick/swift-evolution/blob/diagnose-implicit-raw-bitwise/proposals/nnnn-implicit-raw-bitwise-conversion.md#workarounds-for-common-cases

With Swift 5.9 our uses of the index C APIs warned with:

```
.../Sources/IndexStore/IndexStore.swift:299:66: warning: forming 'UnsafeMutableRawPointer' to a variable of type '(SymbolOccurrence, (Symbol, SymbolRoles) -> ())'; this is likely incorrect because '(SymbolOccurrence, (Symbol, SymbolRoles) -> ())' may contain an object reference.
```

This solution is referenced in the swift-evolution proposal's common
workarounds: https://github.com/atrick/swift-evolution/blob/diagnose-implicit-raw-bitwise/proposals/nnnn-implicit-raw-bitwise-conversion.md#workarounds-for-common-cases
@keith keith marked this pull request as ready for review July 12, 2023 20:29
@keith keith mentioned this pull request Jul 12, 2023
@keith keith enabled auto-merge (squash) July 12, 2023 20:30
@keith keith merged commit e60169c into main Jul 12, 2023
@keith keith deleted the ks/use-withunsafemutablepointer-for-c-calls branch July 12, 2023 20:35
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