Skip to content

Commit

Permalink
THRIFT-5350 char is unsigned on non-x86 arches, use signed char to av…
Browse files Browse the repository at this point in the history
…oid compiler warning about always true comparisons

Patch: Orion Poplawski

This closes #2331
  • Loading branch information
opoplawski authored and Jens-G committed Feb 17, 2021
1 parent 055fe67 commit 36bd59f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/cpp/src/thrift/generate/t_delphi_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,7 @@ std::string t_delphi_generator::make_pascal_string_literal(std::string value) {
}

result << "'";
for (char const &c: value) {
for (signed char const c: value) {
if( (c >= 0) && (c < 32)) { // convert ctrl chars, but leave UTF-8 alone
result << "#" << (int)c;
} else if (c == '\'') {
Expand Down

0 comments on commit 36bd59f

Please sign in to comment.