-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
several -Wconversion and/or -Wsign-conversion warnings on MINGW when formatting std::chrono::system_clock::now() #4268
Comments
The first warning ( |
Could you provide a godbolt repro? |
I don't believe godbolt supports fmtlib with MINGW? |
As I mentioned above, I thought most of these fmt trunk warning should be reproducible on any platform. I have now tried and succeeded to reproduce a very similar set of warnings under ubuntu 24.04 gcc13.3 (gcc 14.2 also shows them). See warnings below with gcc command line. But slightly annoyingly, godbolt does not show these. https://godbolt.org/z/qP9qGrYh9 I have selected fmtlib/trunk on that godbolt link, but how often does godbolt actually
|
OK, these are sufficient repro details, we don't need godbolt. |
Note: on release fmtlib 11.02 this was only occurring on the MINGW64 msys2 environment , not on MINGW32 nor on UCRT64 nor on CLANG64, and the warning was quite different. It was a -Wconversion (now a -Wsign-conversion):
fmtlib 11.02 warning on MINGW64
As part of reporting this issues, when I built with latest master, and there are now several warnings from the same c++ code on MINGW64, UCRT64, MINGW32 (but not on CLANG64). So the obviously different implementation on latest master arguably "contains a regression" with respect to conversion/sign warnings on several msys2 environments. I have not tested fmtlib@master/HEAD on "normal" gcc environment like ubuntu, but given the nature of the warnings below, I suspect they may occur there too.
Being thrown on my msys2 matrix CI tests, and stops me running with -Werror.
c++ code to reproduce:
fmtlib fresh checkout from master branch:
cmake config:
compile command on updated MINGW64, UCRT64, MINGW32 (but not on CLANG64), which triggers warning
warnings:
The text was updated successfully, but these errors were encountered: