Use || instead of | for logical expressions
In its last action before being turned off the VC++ compiler said:
warning.cpp(2): warning C4554: '|': check operator precedence for
possible error; use parentheses to clarify precedence
The code is not wrong, but it is confusing. By default we should use
logical operators for logical expressions, and bitwise operators for
bitwise expressions.
See also this request for a similar warning in clang:
https://bugs.llvm.org/show_bug.cgi?id=37155
Bug: 825568
Change-Id: I339744f004258137d72b23bfe047901dd40be4ad
Reviewed-on: https://chromium-review.googlesource.com/1015780Reviewed-by:
Timothy Loh <timloh@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551550}
Showing
Please register or sign in to comment