Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,19 @@ jobs:
- run: ./ci/install_bazel.sh
- run: ./ci/do_ci.sh bazel.test

# Verify that we can work on architectures that default to use an unsigned char
# See https://github.com/lightstep/lightstep-tracer-cpp/issues/246
# https://github.com/lightstep/lightstep-tracer-cpp/pull/245
unsigned_char_test:
resource_class: xlarge
docker:
- image: ubuntu:18.04
steps:
- checkout
- run: ./ci/setup_build_environment.sh
- run: ./ci/install_bazel.sh
- run: ./ci/do_ci.sh bazel.unsigned_char.test

asan:
resource_class: xlarge
docker:
Expand Down Expand Up @@ -294,6 +307,7 @@ workflows:
- cmake_no_grpc
- cmake_with_grpc
- test
- unsigned_char_test
- asan
- tsan
- windows
Expand Down
4 changes: 4 additions & 0 deletions ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ elif [[ "$1" == "bazel.test" ]]; then
bazel build -c dbg $BAZEL_OPTIONS -- //... -//benchmark/...
bazel test -c dbg $BAZEL_TEST_OPTIONS //...
exit 0
elif [[ "$1" == "bazel.unsigned_char.test" ]]; then
bazel build -c dbg --copt -funsigned-char $BAZEL_OPTIONS -- //... -//benchmark/...
bazel test -c dbg --copt -funsigned-char $BAZEL_TEST_OPTIONS //...
exit 0
elif [[ "$1" == "bazel.asan" ]]; then
setup_clang_toolchain
bazel test -c dbg \
Expand Down
6 changes: 4 additions & 2 deletions src/common/utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ timeval ToTimeval(std::chrono::microseconds microseconds) {
static void WriteEscapedString(std::ostringstream& writer,
opentracing::string_view s) {
writer << '"';
for (char c : s) {
for (auto c_prime : s) {
auto c = static_cast<signed char>(c_prime);
switch (c) {
case '"':
writer << R"(\")";
Expand All @@ -72,7 +73,8 @@ static void WriteEscapedString(std::ostringstream& writer,
writer << R"(\t)";
break;
default:
if ('\x00' <= c && c <= '\x1f') {
if (static_cast<signed char>('\x00') <= c &&
c <= static_cast<signed char>('\x1f')) {
writer << R"(\u)";
writer << std::hex << std::setw(4) << std::setfill('0')
<< static_cast<int>(c);
Expand Down