File tree Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 44
44
- run : ./ci/install_bazel.sh
45
45
- run : ./ci/do_ci.sh bazel.test
46
46
47
+ # Verify that we can work on architectures that default to use an unsigned char
48
+ # See https://github.com/lightstep/lightstep-tracer-cpp/issues/246
49
+ # https://github.com/lightstep/lightstep-tracer-cpp/pull/245
50
+ unsigned_char_test :
51
+ resource_class : xlarge
52
+ docker :
53
+ - image : ubuntu:18.04
54
+ steps :
55
+ - checkout
56
+ - run : ./ci/setup_build_environment.sh
57
+ - run : ./ci/install_bazel.sh
58
+ - run : ./ci/do_ci.sh bazel.unsigned_char.test
59
+
47
60
asan :
48
61
resource_class : xlarge
49
62
docker :
@@ -294,6 +307,7 @@ workflows:
294
307
- cmake_no_grpc
295
308
- cmake_with_grpc
296
309
- test
310
+ - unsigned_char_test
297
311
- asan
298
312
- tsan
299
313
- windows
Original file line number Diff line number Diff line change @@ -79,6 +79,10 @@ elif [[ "$1" == "bazel.test" ]]; then
79
79
bazel build -c dbg $BAZEL_OPTIONS -- //... -//benchmark/...
80
80
bazel test -c dbg $BAZEL_TEST_OPTIONS //...
81
81
exit 0
82
+ elif [[ " $1 " == " bazel.unsigned_char.test" ]]; then
83
+ bazel build -c dbg --copt -funsigned-char $BAZEL_OPTIONS -- //... -//benchmark/...
84
+ bazel test -c dbg --copt -funsigned-char $BAZEL_TEST_OPTIONS //...
85
+ exit 0
82
86
elif [[ " $1 " == " bazel.asan" ]]; then
83
87
setup_clang_toolchain
84
88
bazel test -c dbg \
Original file line number Diff line number Diff line change @@ -51,7 +51,8 @@ timeval ToTimeval(std::chrono::microseconds microseconds) {
51
51
static void WriteEscapedString (std::ostringstream& writer,
52
52
opentracing::string_view s) {
53
53
writer << ' "' ;
54
- for (char c : s) {
54
+ for (auto c_prime : s) {
55
+ auto c = static_cast <signed char >(c_prime);
55
56
switch (c) {
56
57
case ' "' :
57
58
writer << R"( \")" ;
@@ -72,7 +73,8 @@ static void WriteEscapedString(std::ostringstream& writer,
72
73
writer << R"( \t)" ;
73
74
break ;
74
75
default :
75
- if (' \x00 ' <= c && c <= ' \x1f ' ) {
76
+ if (static_cast <signed char >(' \x00 ' ) <= c &&
77
+ c <= static_cast <signed char >(' \x1f ' )) {
76
78
writer << R"( \u)" ;
77
79
writer << std::hex << std::setw (4 ) << std::setfill (' 0' )
78
80
<< static_cast <int >(c);
You can’t perform that action at this time.
0 commit comments