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

Clang 18.1.8 build warns about usage of int <- abs(float) #11

Open
LowLevelMahn opened this issue Jul 17, 2024 · 0 comments
Open

Clang 18.1.8 build warns about usage of int <- abs(float) #11

LowLevelMahn opened this issue Jul 17, 2024 · 0 comments

Comments

@LowLevelMahn
Copy link

only in test-code but maybe relevant

In file included from /home/linux/temp/solver_tests/Adjacent/src/test.cpp:4:
/home/linux/temp/solver_tests/Adjacent/include/constraint.hpp:141:30: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
  141 |                 cur_value += abs(e->eval());
      |                              ^
/home/linux/temp/solver_tests/Adjacent/include/constraint.hpp:141:30: note: use function 'std::abs' instead
  141 |                 cur_value += abs(e->eval());
      |                              ^~~
      |                              std::abs
/home/linux/temp/solver_tests/Adjacent/include/constraint.hpp:231:30: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
  231 |                 cur_value += abs(el->eval());
      |                              ^
/home/linux/temp/solver_tests/Adjacent/include/constraint.hpp:231:30: note: use function 'std::abs' instead
  231 |                 cur_value += abs(el->eval());
      |                              ^~~
      |                              std::abs
/home/linux/temp/solver_tests/Adjacent/include/constraint.hpp:540:30: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
  540 |                 cur_value += abs(el->eval());
      |                              ^
/home/linux/temp/solver_tests/Adjacent/include/constraint.hpp:540:30: note: use function 'std::abs' instead
  540 |                 cur_value += abs(el->eval());
      |                              ^~~
      |                              std::abs
3 warnings generated.
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