Skip to content

Support unsigned 64-bit integers (uint64_t) exceeding INT64_MAX (#501)#513

Open
sndth wants to merge 4 commits intofktn-k:developfrom
sndth:unsigned-integers
Open

Support unsigned 64-bit integers (uint64_t) exceeding INT64_MAX (#501)#513
sndth wants to merge 4 commits intofktn-k:developfrom
sndth:unsigned-integers

Conversation

@sndth
Copy link
Copy Markdown
Contributor

@sndth sndth commented Mar 4, 2026

Large positive decimal scalars whose value exceeds INT64_MAX (e.g. xxHash digests, high-half UUID fields) were silently parsed as STRING nodes instead of INTEGER nodes. Calling as_int() on such a node then threw type_error, making the value unreachable without ugly string post-processing.

This PR adds transparent uint64_t storage support inside the existing int64_t field via a new style flag, uint_bit, and exposes two new public APIs: is_uint() and as_uint().


Pull Request Checklist

Read the CONTRIBUTING.md file for detailed information.

  • Changes are described in the pull request or in a referenced issue.
  • The test suite compiles and runs without any error.
  • The code coverage on your branch is 100%.
  • The documentation is updated if you added/changed a feature.

Please don't

  • The C++11 support varies between different compilers and versions. Please note the list of supported compilers. Some compilers like GCC 4.7 (and earlier), Clang 3.3 (and earlier), or Microsoft Visual Studio 13.0 and earlier are known not to work due to missing or incomplete C++11 support. Please refrain from proposing changes that work around these compiler's limitations with #ifdefs or other means.
  • Please refrain from proposing changes that would break YAML specifications. If you propose a conformant extension of YAML to be supported by the library, please motivate this extension.
  • Please do not open pull requests that address multiple issues.

Large positive decimal scalars whose value exceeds INT64_MAX (e.g. xxHash digests, high-half UUID fields) were silently parsed as STRING nodes instead of INTEGER nodes. Calling as_int() on such a node then threw type_error, making the value unreachable without ugly string post-processing.
@sndth sndth requested a review from fktn-k as a code owner March 4, 2026 22:49
@sndth sndth changed the title Support unsigned 64-bit integers (uint64_t) exceeding INT64_MAX (issue #501) Support unsigned 64-bit integers (uint64_t) exceeding INT64_MAX (issue https://github.com/fktn-k/fkYAML/issues/501) Mar 4, 2026
@sndth sndth changed the title Support unsigned 64-bit integers (uint64_t) exceeding INT64_MAX (issue https://github.com/fktn-k/fkYAML/issues/501) Support unsigned 64-bit integers (uint64_t) exceeding INT64_MAX (#501) Mar 4, 2026
@sndth sndth mentioned this pull request Mar 4, 2026
2 tasks
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.

1 participant