Skip to content

Conversation

@xymus
Copy link
Contributor

@xymus xymus commented May 25, 2021

Mark the arguments of memcmp in SwiftShims with _Nullable on Darwin. This realigns the nested prototype of memcmp from SwiftShims with the definition in usr/include/string.h and keep it from being a source of confusion for the compiler.

  • Scope: The inconsistent definitions of memcmp caused compiler crash in projects that used memcmp directly or used Data == Data with optimizations enabled that replaced it with a memcmp call.
  • Risk: Low, all existing calls to memcmp should remain valid.
  • Origination: Unclear, changes in the libraries import order likely made the original definition of memcmp less obvious, making this inconsistency visible.
  • Resolves rdar://78270152
  • Cherry-pick of [SwiftShims] Make the void* arguments of memcmp nullable #36666

xymus added 2 commits May 24, 2021 18:22
This should correspond to the definition of memcmp in
usr/include/string.h and keep it from being a source of confusion for
the compiler.

rdar://69876253
rdar://78270152
@xymus xymus added the r5.4 label May 25, 2021
@xymus xymus requested a review from airspeedswift May 25, 2021 01:32
@xymus
Copy link
Contributor Author

xymus commented May 25, 2021

@swift-ci Please test

@xymus
Copy link
Contributor Author

xymus commented May 25, 2021

@swift-ci Please smoke test

@xymus
Copy link
Contributor Author

xymus commented May 25, 2021

@swift-ci Please nominate

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - ead48ff

@xymus
Copy link
Contributor Author

xymus commented May 25, 2021

@swift-ci Please test macOS platform

@xymus xymus merged commit fb774de into swiftlang:release/5.4 May 25, 2021
@xymus xymus deleted the fix-memcmp-definition-5.4 branch May 25, 2021 13:11
@AnthonyLatsis AnthonyLatsis added swift 5.4 🍒 release cherry pick Flag: Release branch cherry picks labels Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🍒 release cherry pick Flag: Release branch cherry picks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants