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

Suppress -Wfloat-equal warning #1043

Conversation

dmitrykobets-msft
Copy link
Member

@dmitrykobets-msft dmitrykobets-msft commented Mar 24, 2022

-Wfloat-equal is concerned with the floating-point comparison in gsl::narrow. However, the use of this comparison is by design.

Resolves #1038

The comparison here is done purposefully to categorize ill effects of narrowing conversion.
Note, using #pragma GCC will suppress this warning for both GCC and Clang.
@dmitrykobets-msft dmitrykobets-msft merged commit 2bfd495 into microsoft:main Apr 14, 2022
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.

gsl::narrow warnings for integer to float cast
2 participants