Skip to content

Commit 9666341

Browse files
committed
Fix a rapidjson compile error in mac.
Summary: This diff fixes the following compilation error in mac. ./third-party/rapidjson/reader.h:422:31: error: comparison of constant 256 with expression of type 'Ch' (aka 'char') is always true [-Werror,-Wtautological-constant-out-of-range-compare] if ((sizeof(Ch) == 1 || e < 256) && escape[(unsigned char)e]) ~ ^ ~~~ 1 error generated. Test Plan: make db_test Reviewers: haobo, sdong, igor, ljin Reviewed By: ljin Subscribers: leveldb Differential Revision: https://reviews.facebook.net/D19245
1 parent 854abaf commit 9666341

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

third-party/rapidjson/reader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ class GenericReader {
419419
Ch c = s.Take();
420420
if (c == '\\') { // Escape
421421
Ch e = s.Take();
422-
if ((sizeof(Ch) == 1 || e < 256) && escape[(unsigned char)e])
422+
if ((sizeof(Ch) == 1 || (int)e < 256) && escape[(unsigned char)e])
423423
RAPIDJSON_PUT(escape[(unsigned char)e]);
424424
else if (e == 'u') { // Unicode
425425
unsigned codepoint = ParseHex4(s);

0 commit comments

Comments
 (0)