Skip to content

Integer serialization fix for 32 bit platform compatibility #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

clintonpi
Copy link
Contributor

@clintonpi clintonpi commented Nov 29, 2024

Motivation:

RFC 9651 permits serializing an integer in the range of -999,999,999,999,999 to 999,999,999,999,999 inclusive (Section 4.1.4-2.1.1). As RFC9651BareItem takes values integer or date with an associated value of type Int, that range is implicitly more constrained on 32-bit platforms to a subset range of Int32.min to Int32.max inclusive.

Modifications:

  • Adjust RFC9651BareItem to take values integer or date with an associated value of type Int64 instead, which is sufficient for the permitted range.

Result:

Compatibility for the Integer and Date Structured Types on 32-bit platforms.

@Lukasa Lukasa added the 🆕 semver/minor Adds new public API. label Dec 9, 2024
Motivation:

[RFC 9651](https://www.ietf.org/rfc/rfc9651.html) permits serializing an integer in the range of -999,999,999,999,999 to 999,999,999,999,999 inclusive ([Section 4.1.4-2.1.1](https://www.ietf.org/rfc/rfc9651.html#section-4.1.4-2.1.1)). As `RFC9651BareItem` takes values `integer` or `date` with an associated value of type `Int`, that range is implicitly more constrained on 32-bit platforms to a subset range of `-Int32.min` to `Int32.max` inclusive.

Modifications:

- Adjust `RFC9651BareItem` to take values `integer` or `date` with an associated value of type `Int64` instead, which is sufficient for the permitted range.

Result:

Compatibility for the Integer and Date Structured Types on 32-bit platforms.
@clintonpi clintonpi force-pushed the integer-serialization-fix-for-32-bit-platform-compatibility branch from 0dde4ce to fb72db4 Compare December 10, 2024 09:34
Copy link
Contributor

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it, looks great.

@Lukasa
Copy link
Contributor

Lukasa commented Dec 12, 2024

API breakage is expected, we haven't shipped the API we're breaking.

@Lukasa Lukasa merged commit 1a14678 into apple:main Dec 12, 2024
21 of 22 checks passed
@clintonpi clintonpi deleted the integer-serialization-fix-for-32-bit-platform-compatibility branch December 13, 2024 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🆕 semver/minor Adds new public API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants