Skip to content
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

wrong length detected for atomic<uint64_t> #507

Closed
tamboril opened this issue May 3, 2017 · 1 comment
Closed

wrong length detected for atomic<uint64_t> #507

tamboril opened this issue May 3, 2017 · 1 comment

Comments

@tamboril
Copy link

tamboril commented May 3, 2017

For some reason, a uint64_t is formatted fine, but an std::atomic<uint64_t>, which defines
operator uint64() gets truncated to an int.

So these yield different output:

auto c = std::atomic<uint64_t> { 0x0000'0001'0000'0021ull };
cout << fmt::format("{}", c) << endl;
cout << fmt::format("{}", c.load()) << endl;

Output: 
33
4294967329
@vitaut
Copy link
Contributor

vitaut commented May 6, 2017

Fixed in 07ed421. Thanks for the great bug report!

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

No branches or pull requests

2 participants