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

vector operators bool warnings #850

Open
AlexeySachkov opened this issue Jan 9, 2024 · 0 comments
Open

vector operators bool warnings #850

AlexeySachkov opened this issue Jan 9, 2024 · 0 comments

Comments

@AlexeySachkov
Copy link
Contributor

Can't insert a nice source code snippet in here, because source code is generated. Generator can be found here: tests/vector_operators/generate_vector_operators.py

Build log:

[936/1195] Building CXX object tests/vector_operators/CMakeFiles/test_vector_operators_objects.dir/vector_operators_bool.cpp.o
tests/vector_operators/vector_operators_bool.cpp:732:40: warning: converting the result of '<<' to a boolean; did you mean '(static_cast<_Bool>(1) << static_cast<_Bool>(2)) != 0'? [-Wint-in-bool-context]
  732 |       resArr[i] = static_cast<bool>(1) << static_cast<bool>(2);
      |                                        ^
tests/vector_operators/vector_operators_bool.cpp:836:40: warning: converting the result of '<<' to a boolean; did you mean '(static_cast<_Bool>(1) << static_cast<_Bool>(2)) != 0'? [-Wint-in-bool-context]
  836 |       resArr[i] = static_cast<bool>(1) << static_cast<bool>(2);
      |                                        ^
tests/vector_operators/vector_operators_bool.cpp:976:19: warning: bitwise negation of a boolean expression always evaluates to 'true'; did you mean logical negation? [-Wbool-operation]
  976 |       resArr[i] = ~static_cast<bool>(1);
      |                   ^~~~~~~~~~~~~~~~~~~~~
      |                   !
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