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:
parent
70f345012d
commit
0aa36101f4
|
@ -280,7 +280,7 @@ CheckedError Parser::Next() {
|
||||||
int unicode_high_surrogate = -1;
|
int unicode_high_surrogate = -1;
|
||||||
|
|
||||||
while (*cursor_ != c) {
|
while (*cursor_ != c) {
|
||||||
if (*cursor_ < ' ' && *cursor_ >= 0)
|
if (*cursor_ < ' ' && static_cast<signed char>(*cursor_) >= 0)
|
||||||
return Error("illegal character in string constant");
|
return Error("illegal character in string constant");
|
||||||
if (*cursor_ == '\\') {
|
if (*cursor_ == '\\') {
|
||||||
cursor_++;
|
cursor_++;
|
||||||
|
|
Loading…
Reference in New Issue