Portable range check for *cursor_ value. (#4582)

Avoids the following compile error when char is unsigned:

error: comparison of unsigned expression >= 0 is always true [-Werror,-Wtautological-unsigned-zero-compare]
This commit is contained in:
brianhall77 2018-01-04 16:03:03 -08:00 committed by Wouter van Oortmerssen
parent 70f345012d
commit 0aa36101f4
1 changed files with 1 additions and 1 deletions

View File

@ -280,7 +280,7 @@ CheckedError Parser::Next() {
int unicode_high_surrogate = -1;
while (*cursor_ != c) {
if (*cursor_ < ' ' && *cursor_ >= 0)
if (*cursor_ < ' ' && static_cast<signed char>(*cursor_) >= 0)
return Error("illegal character in string constant");
if (*cursor_ == '\\') {
cursor_++;