[all-commits] [llvm/llvm-project] 8de07c: Fix a -Wbitwise-conditional-parentheses warning in...
Nico Weber via All-commits
all-commits at lists.llvm.org
Wed Feb 19 04:28:02 PST 2020
Branch: refs/heads/release/10.x
Home: https://github.com/llvm/llvm-project
Commit: 8de07c31c1aafa848f515d721e6cf065a0701e81
https://github.com/llvm/llvm-project/commit/8de07c31c1aafa848f515d721e6cf065a0701e81
Author: Nico Weber <thakis at chromium.org>
Date: 2020-02-19 (Wed, 19 Feb 2020)
Changed paths:
M libunwind/src/UnwindCursor.hpp
Log Message:
-----------
Fix a -Wbitwise-conditional-parentheses warning in _LIBUNWIND_ARM_EHABI libunwind builds
```
src/UnwindCursor.hpp:1344:51: error: operator '?:' has lower precedence than '|';
'|' will be evaluated first [-Werror,-Wbitwise-conditional-parentheses]
_info.flags = isSingleWordEHT ? 1 : 0 | scope32 ? 0x2 : 0; // Use enum?
~~~~~~~~~~~ ^
src/UnwindCursor.hpp:1344:51: note: place parentheses around the '|' expression
to silence this warning
_info.flags = isSingleWordEHT ? 1 : 0 | scope32 ? 0x2 : 0; // Use enum?
^
( )
src/UnwindCursor.hpp:1344:51: note: place parentheses around the '?:' expression
to evaluate it first
_info.flags = isSingleWordEHT ? 1 : 0 | scope32 ? 0x2 : 0; // Use enum?
^
( )
```
But `0 |` is a no-op for either of those two interpretations, so I think
what was meant here was
```
_info.flags = (isSingleWordEHT ? 1 : 0) | (scope32 ? 0x2 : 0); // Use enum?
```
Previously, if `isSingleWordEHT` was set, bit 2 would never be set. Now
it is. From what I can tell, the only thing that checks these bitmask is
ProcessDescriptors in Unwind-EHABI.cpp, and that only cares about bit 1,
so in practice this shouldn't have much of an effect.
Differential Revision: https://reviews.llvm.org/D73890
(cherry picked from commit 221c5af4e4f4a504a4d1f352dd7b76d305e56a62)
More information about the All-commits
mailing list