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

[TRIVIAL] Fix bitwise or on boolean operands warning / error #4183

Closed
wants to merge 1 commit into from

Conversation

ximinez
Copy link
Collaborator

@ximinez ximinez commented May 28, 2022

High Level Overview of Change

I compile rippled with -werr. Clang 14 generated the following error.

src/ripple/app/tx/impl/CreateOffer.cpp:731:13: error: use of bitwise '&' with boolean operands [-Werror,-Wbitwise-instead-of-logical]
        if (!takerAmount.in.native() & !takerAmount.out.native())
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                     &&
src/ripple/app/tx/impl/CreateOffer.cpp:731:13: note: cast one or both operands to int to silence this warning
1 error generated.

Context of Change

I updated to Ubuntu 22.04, which ships with clang 14. Building rippled on the new system failed because of this issue.

Type of Change

  • [X ] Refactor (non-breaking change that only restructures code)

Copy link
Collaborator

@scottschurr scottschurr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotta love those compiler warnings! Thanks for finding and fixing this @ximinez!

@greg7mdp
Copy link
Contributor

I had a hard time finding it, but I knew I had seen this before: seelabs@057329b

@ximinez ximinez added the Passed Passed code review & PR owner thinks it's ready to merge. Perf sign-off may still be required. label May 31, 2022
@nbougalis nbougalis mentioned this pull request Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Passed Passed code review & PR owner thinks it's ready to merge. Perf sign-off may still be required.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants