-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
clang -Wimplicit-int-float-conversion fixes #38886
clang -Wimplicit-int-float-conversion fixes #38886
Conversation
@@ -1237,8 +1237,12 @@ float fastexp( float x ) | |||
float f; | |||
int i; | |||
} u, v; | |||
#pragma GCC diagnostic push | |||
#pragma GCC diagnostic ignored "-Wpragmas" |
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.
Is it the same thing as I did in #38431?
#pragma GCC diagnostic ignored "-Wunknown-pragmas"
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.
No, this one means "STFU about any warnings related to pragmas".
GCC was choking on the other ignored pragma because it didn't recognize the warning flag.
Co-Authored-By: ZhilkinSerg <[email protected]>
Summary
SUMMARY: None
Purpose of change
Fixes #36510
Fixes #37006
Clang 10 adds a new warning, this corrects our code or silences the warning when "we know better":tm:
Describe the solution
Replace INT_MAX with FLT_MAX in a number of places.
Silence the warning due to the hackery in fastexp().
Describe alternatives you've considered
Could silence more of the warnings, but FLT_MAX seems to be correct in all of those cases.
Could use std::numeric_limits::max() instead, but that's kind of just bikeshedding.
Additional Context
This replaces #38881 since something about github permissions prevents me from applying a fix to that one.