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

Force use a signed char (On ARM char is unsigned by default) #3362

Merged
merged 1 commit into from
Mar 22, 2023

Conversation

phprus
Copy link
Contributor

@phprus phprus commented Mar 22, 2023

Environment:

docker-desktop:/ # uname -a
Linux docker-desktop 5.15.49-linuxkit #1 SMP PREEMPT Tue Sep 13 07:51:32 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux

Error:

[ RUN      ] chrono_test.cpp20_duration_subsecond_support
/fmt/fmt-master/test/chrono-test.cc:823: Failure
Expected equality of these values:
  fmt::format("{:%S}", std::chrono::duration<char, std::ratio<1, 100>>(0x80))
    Which is: "01.28"
  "-01.28"
[  FAILED  ] chrono_test.cpp20_duration_subsecond_support (0 ms)

On ARM gcc char is unsigned:
https://developer.arm.com/documentation/den0013/d/Porting/Miscellaneous-C-porting-issues/unsigned-char-and-signed-char
https://trofi.github.io/posts/203-signed-char-or-unsigned-char.html

@vitaut vitaut merged commit f6276a2 into fmtlib:master Mar 22, 2023
@vitaut
Copy link
Contributor

vitaut commented Mar 22, 2023

Thanks

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.

2 participants