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

Some codes failed -Werror=float-equal compiler flag, please fix it. #741

Open
jymchng opened this issue Jul 11, 2024 · 0 comments
Open

Some codes failed -Werror=float-equal compiler flag, please fix it. #741

jymchng opened this issue Jul 11, 2024 · 0 comments

Comments

@jymchng
Copy link

jymchng commented Jul 11, 2024

Example error message.

/root/c_projects/c_template_two/build/coverage/_deps/unity-src/src/unity.c: In function ‘UnityPrintFloat’:
/root/c_projects/c_template_two/build/coverage/_deps/unity-src/src/unity.c:355:16: error: comparing floating-point with ‘==’ or ‘!=’ is unsafe [-Werror=float-equal]
  355 |     if (number == 0.0f)
      |                ^~
/root/c_projects/c_template_two/build/coverage/_deps/unity-src/src/unity.c:422:52: error: comparing floating-point with ‘==’ or ‘!=’ is unsafe [-Werror=float-equal]
  422 |         if ((n & 1) && (((UNITY_DOUBLE)n - number) == 0.5f))
      |                                                    ^~
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

No branches or pull requests

1 participant