Skip to content

Conversation

waywardmonkeys
Copy link
Contributor

Clang 4.0 introduced -Wdouble-promotion, so check for and disable
that on clang as we do on gcc.

The old style casts warning is already disabled globally in this file
for clang, so it doesn't need to be re-disabled within this scope.

Clang 4.0 introduced -Wdouble-promotion, so check for and disable
that on clang as we do on gcc.

The old style casts warning is already disabled globally in this file
for clang, so it doesn't need to be re-disabled within this scope.
@ocornut
Copy link
Owner

ocornut commented Sep 17, 2017

@waywardmonkeys Could you post the float to double promotion warnings you get without disabling them with this change? Thanks!

@waywardmonkeys
Copy link
Contributor Author

Here you go!

double_promotion_warnings.txt

@ocornut
Copy link
Owner

ocornut commented Sep 19, 2017

Oh wow I see, it gives that warning when passing parameters through an ellipsis (...), it's a little odd because that has been standard behavior for decades and there's no way to pass a pure float to those function ASAP.
I wonder what Clang developers are expecting. That we stop using float and ... e.g. in printf style function, or is there a workaround?

@ocornut ocornut merged commit ba12d37 into ocornut:master Sep 19, 2017
@MrSapps
Copy link

MrSapps commented Sep 19, 2017

Its a catch all since it will warn if you pass mis-matched types for any format string. Usually its serious and leads to a crash/UB. In this case you'd have to cast or add a helper like printf("%f", AsDouble(3.14f)); or just turn it off as you have ;)

@waywardmonkeys waywardmonkeys deleted the improve-clang-warnings branch April 25, 2018 07:21
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