Skip to content

Commit 7135ec6

Browse files
aligusnetcopybara-github
authored andcommitted
PR #1559: Fix comparison of integer expressions of different signedness 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
1 parent 065d50d commit 7135ec6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

absl/hash/internal/hash.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ AbslHashValue(H hash_state, const absl::variant<T...>& v) {
818818
template <typename H, size_t N>
819819
H AbslHashValue(H hash_state, const std::bitset<N>& set) {
820820
typename H::AbslInternalPiecewiseCombiner combiner;
821-
for (int i = 0; i < N; i++) {
821+
for (size_t i = 0; i < N; i++) {
822822
unsigned char c = static_cast<unsigned char>(set[i]);
823823
hash_state = combiner.add_buffer(std::move(hash_state), &c, sizeof(c));
824824
}

0 commit comments

Comments
 (0)