Skip to content

Fix serialization of native integral types - #11

Merged
rwindegger merged 4 commits into
rwindegger:mainfrom
swdaa:fix/native-integral-types
Aug 25, 2026
Merged

Fix serialization of native integral types#11
rwindegger merged 4 commits into
rwindegger:mainfrom
swdaa:fix/native-integral-types

Conversation

@swdaa

@swdaa swdaa commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix serialization of native integral types that are not aliases of the
fixed-width integer types handled by the existing overloads.

On macOS, std::size_t is unsigned long, while std::uint64_t may be
a different underlying type. As a result, std::size_t could fall through
to the custom-object overload and attempt to call value.pack() /
value.unpack().

This change routes otherwise-unhandled integral types through the existing
fixed-width integer serialization overloads and excludes integral types from
the custom-object fallback.

Testing

  • Built the project with Clang on macOS
  • Existing std::vector<std::size_t> array test now compiles
  • All tests pass with ctest --test-dir build --output-on-failure

Copilot AI lite review requested due to automatic review settings August 9, 2026 08:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes MsgPack serialization for native integral types (e.g., std::size_t) whose underlying type may not be one of the fixed-width integer typedefs, preventing them from incorrectly falling into the custom-object pack()/unpack() fallback.

Changes:

  • Added pack_type / unpack_type overloads to route otherwise-unhandled std::integral types through existing fixed-width integer serialization.
  • Excluded integral types from the custom-object fallback overloads so they don’t attempt value.pack() / value.unpack().

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread include/msgpack23/msgpack23.h Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@codecov

codecov Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.91%. Comparing base (53f2594) to head (ab48c59).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #11   +/-   ##
=======================================
  Coverage   93.91%   93.91%           
=======================================
  Files           1        1           
  Lines         493      493           
=======================================
  Hits          463      463           
  Misses         30       30           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rwindegger
rwindegger merged commit 6f3b183 into rwindegger:main Aug 25, 2026
14 checks passed
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.

3 participants