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
Fixes compilation error on MacOS #2040
Conversation
error: implicit conversion from 'size_t' (aka 'unsigned long') to 'CGFloat' (aka 'double') may lose precision [-Werror,-Wimplicit-int-float-conversion]
Codecov Report
@@ Coverage Diff @@
## master #2040 +/- ##
=======================================
Coverage 7.51% 7.51%
=======================================
Files 185 185
Lines 15848 15847 -1
Branches 4170 4170
=======================================
Hits 1191 1191
- Misses 14297 14524 +227
+ Partials 360 132 -228
Continue to review full report at Codecov.
|
Did you also compile the tests and examples with that extra warning you added? If we're going to fix this warning, I'd prefer that we add it to CompilerWarnings.cmake and see what else gets caught when the CI pipeline runs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I switched to this same version of Clang and was able to recreate this error without enabling additional compiler warnings so we must already be using this warning. The tests and examples build fine too. Thanks for the contribution!
Thanks for this fix! 🥳 |
Description
This change fixes the following compilation error on MacOS with Clang 13 (mainline clang installed through HomeBrew
brew install llvm
).Tasks
How to test this PR?
Compile SFML with
-Werror,-Wimplicit-int-float-conversion