mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-28 17:10:01 +00:00
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:
committed by
Wouter van Oortmerssen
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_++;
|
||||||
|
|||||||
Reference in New Issue
Block a user