Skip to content

Commit

Permalink
PR #1559: Fix comparison of integer expressions of different signedne…
Browse files Browse the repository at this point in the history
…ss warning

Imported from GitHub PR #1559

```
//absl/hash/internal/hash.h:633:21: error: comparison of integer expressions of different signedness: 'int' and 'long unsigned int' [-Werror=sign-compare]
```

This warning is specific to the hashing of `std::bitset<>` on Big Endian platforms such as s390x

Merge 3f34d80 into 065d50d

Merging this change closes #1559

COPYBARA_INTEGRATE_REVIEW=#1559 from aligusnet:20211102.0-mongo 3f34d80
PiperOrigin-RevId: 578897545
Change-Id: Ifd1c947af3ad01e8e2a6241030ed29fb00842d53
  • Loading branch information
aligusnet authored and copybara-github committed Nov 2, 2023
1 parent 065d50d commit 7135ec6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion absl/hash/internal/hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ AbslHashValue(H hash_state, const absl::variant<T...>& v) {
template <typename H, size_t N>
H AbslHashValue(H hash_state, const std::bitset<N>& set) {
typename H::AbslInternalPiecewiseCombiner combiner;
for (int i = 0; i < N; i++) {
for (size_t i = 0; i < N; i++) {
unsigned char c = static_cast<unsigned char>(set[i]);
hash_state = combiner.add_buffer(std::move(hash_state), &c, sizeof(c));
}
Expand Down

0 comments on commit 7135ec6

Please sign in to comment.