From 10cb83579feb53e7524ec899c0bff19161877669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Thu, 23 Oct 2014 02:46:15 -0700 Subject: [PATCH 1/6] gcc fixes --- common.gypi | 8 +++++++- common/glfw_view.cpp | 4 ++-- common/http_request_baton_curl.cpp | 10 +++++----- include/mbgl/geometry/buffer.hpp | 6 +++--- include/mbgl/util/pbf.hpp | 4 ++-- include/mbgl/util/transition.hpp | 8 ++++---- src/clipper/clipper.cpp | 2 ++ src/geometry/debug_font_buffer.cpp | 6 +++--- src/map/raster_tile_data.cpp | 4 ++-- src/map/tile.cpp | 16 ++++++++-------- src/map/transform_state.cpp | 4 ++-- src/map/vector_tile_data.cpp | 4 ++-- src/renderer/painter.cpp | 8 ++++---- src/storage/file_source.cpp | 26 +++++++++++++------------- src/storage/http_request.cpp | 4 ++-- src/storage/response.cpp | 2 +- src/style/style.cpp | 1 + src/style/style_parser.cpp | 2 ++ src/util/image.cpp | 1 + src/util/raster.cpp | 2 -- test/fixtures/fixture_log.cpp | 12 ++++++------ 21 files changed, 72 insertions(+), 62 deletions(-) diff --git a/common.gypi b/common.gypi index 596db5449..627c18668 100644 --- a/common.gypi +++ b/common.gypi @@ -14,8 +14,14 @@ 'GCC_WARN_UNINITIALIZED_AUTOS': 'YES_AGGRESSIVE', }, }], + ['OS=="linux"', { + 'cflags_cc': [ + '-Wno-unknown-pragmas', # We are using '#pragma mark', but it is only available on Darwin. + '-Wno-literal-suffix', # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61653 + ], + }], ], - 'cflags_cc!': [ '-std=c++11', '-Wall', '-Wextra', '-Wshadow', '-frtti', '-fexceptions' ], + 'cflags_cc': [ '-std=c++11', '-Werror', '-Wall', '-Wextra', '-Wshadow', '-frtti', '-fexceptions' ], 'configurations': { 'Debug': { 'cflags_cc': [ '-g', '-O0', '-fno-omit-frame-pointer','-fwrapv', '-fstack-protector-all', '-fno-common' ], diff --git a/common/glfw_view.cpp b/common/glfw_view.cpp index 53cd068d0..92d1e1908 100644 --- a/common/glfw_view.cpp +++ b/common/glfw_view.cpp @@ -13,8 +13,8 @@ GLFWView::~GLFWView() { glfwTerminate(); } -void GLFWView::initialize(mbgl::Map *map) { - View::initialize(map); +void GLFWView::initialize(mbgl::Map *map_) { + View::initialize(map_); if (!glfwInit()) { fprintf(stderr, "Failed to initialize glfw\n"); diff --git a/common/http_request_baton_curl.cpp b/common/http_request_baton_curl.cpp index b5226e20e..0c3d2b43f 100644 --- a/common/http_request_baton_curl.cpp +++ b/common/http_request_baton_curl.cpp @@ -154,11 +154,11 @@ void curl_perform(uv_poll_t *req, int, int events) { while ((message = curl_multi_info_read(multi, &pending))) { switch (message->msg) { case CURLMSG_DONE: { - CURLContext *context = nullptr; - curl_easy_getinfo(message->easy_handle, CURLINFO_PRIVATE, (char *)&context); + CURLContext *ctx = nullptr; + curl_easy_getinfo(message->easy_handle, CURLINFO_PRIVATE, (char *)&ctx); // Make a copy so that the Baton stays around even after we are calling finish_request - util::ptr baton = context->baton; + util::ptr baton = ctx->baton; // Add human-readable error code if (message->data.result != CURLE_OK) { @@ -242,8 +242,8 @@ int handle_socket(CURL *handle, curl_socket_t sockfd, int action, void *, void * } if (action == CURL_POLL_REMOVE && socketp) { uv_poll_stop(context->poll_handle); - uv_close((uv_handle_t *)context->poll_handle, [](uv_handle_t *handle) { - delete (uv_poll_t *)handle; + uv_close((uv_handle_t *)context->poll_handle, [](uv_handle_t *poll_handle) { + delete (uv_poll_t *)poll_handle; }); context->poll_handle = nullptr; curl_multi_assign(multi, sockfd, NULL); diff --git a/include/mbgl/geometry/buffer.hpp b/include/mbgl/geometry/buffer.hpp index 446177d44..80cc6b9d1 100644 --- a/include/mbgl/geometry/buffer.hpp +++ b/include/mbgl/geometry/buffer.hpp @@ -84,15 +84,15 @@ protected: } // Get a pointer to the item at a given index. - inline void *getElement(size_t index) { + inline void *getElement(size_t i) { if (array == nullptr) { throw std::runtime_error("Buffer was already deleted or doesn't contain elements"); } - if (index * itemSize >= pos) { + if (i * itemSize >= pos) { throw new std::runtime_error("Can't get element after array bounds"); } else { - return static_cast(array) + (index * itemSize); + return static_cast(array) + (i * itemSize); } } diff --git a/include/mbgl/util/pbf.hpp b/include/mbgl/util/pbf.hpp index ab4d60cd3..d017219a5 100644 --- a/include/mbgl/util/pbf.hpp +++ b/include/mbgl/util/pbf.hpp @@ -132,9 +132,9 @@ double pbf::float64() { std::string pbf::string() { uint32_t bytes = static_cast(varint()); - const char *string = reinterpret_cast(data); + const char *string_data = reinterpret_cast(data); skipBytes(bytes); - return std::string(string, bytes); + return std::string(string_data, bytes); } bool pbf::boolean() { diff --git a/include/mbgl/util/transition.hpp b/include/mbgl/util/transition.hpp index 16adc41ce..b78abfa8f 100644 --- a/include/mbgl/util/transition.hpp +++ b/include/mbgl/util/transition.hpp @@ -36,8 +36,8 @@ protected: template class ease_transition : public transition { public: - ease_transition(T from_, T to_, T& value_, timestamp start, timestamp duration) - : transition(start, duration), + ease_transition(T from_, T to_, T& value_, timestamp start_, timestamp duration_) + : transition(start_, duration_), from(from_), to(to_), value(value_) {} @@ -53,8 +53,8 @@ private: template class timeout : public transition { public: - timeout(T final_value_, T& value_, timestamp start, timestamp duration) - : transition(start, duration), + timeout(T final_value_, T& value_, timestamp start_, timestamp duration_) + : transition(start_, duration_), final_value(final_value_), value(value_) {} diff --git a/src/clipper/clipper.cpp b/src/clipper/clipper.cpp index 7571ae143..ea468d69e 100755 --- a/src/clipper/clipper.cpp +++ b/src/clipper/clipper.cpp @@ -48,6 +48,8 @@ #include #include +#pragma GCC diagnostic ignored "-Wshadow" + namespace ClipperLib { #ifdef use_int32 diff --git a/src/geometry/debug_font_buffer.cpp b/src/geometry/debug_font_buffer.cpp index 387a64629..2a0924a1c 100644 --- a/src/geometry/debug_font_buffer.cpp +++ b/src/geometry/debug_font_buffer.cpp @@ -10,9 +10,9 @@ using namespace mbgl; void DebugFontBuffer::addText(const char *text, double left, double baseline, double scale) { uint16_t *coords = nullptr; - size_t length = strlen(text); - for (size_t i = 0; i < length; ++i) { - if (text[i] < 32 || text[i] > 127) { + const size_t len = strlen(text); + for (size_t i = 0; i < len; ++i) { + if (text[i] < 32 || (unsigned char)(text[i]) > 127) { continue; } diff --git a/src/map/raster_tile_data.cpp b/src/map/raster_tile_data.cpp index e7725b7ab..99ca327fe 100644 --- a/src/map/raster_tile_data.cpp +++ b/src/map/raster_tile_data.cpp @@ -5,8 +5,8 @@ using namespace mbgl; -RasterTileData::RasterTileData(Tile::ID id, Map &map, const util::ptr &source) - : TileData(id, map, source), +RasterTileData::RasterTileData(Tile::ID id_, Map &map_, const util::ptr &source_) + : TileData(id_, map_, source_), bucket(map.getTexturepool(), properties) { } diff --git a/src/map/tile.cpp b/src/map/tile.cpp index 1fe0faefd..3070d3fd9 100644 --- a/src/map/tile.cpp +++ b/src/map/tile.cpp @@ -25,13 +25,13 @@ std::forward_list Tile::ID::children(int32_t child_z) const { assert(child_z > z); int32_t factor = std::pow(2, child_z - z); - std::forward_list children; + std::forward_list child_ids; for (int32_t ty = y * factor, y_max = (y + 1) * factor; ty < y_max; ++ty) { for (int32_t tx = x * factor, x_max = (x + 1) * factor; tx < x_max; ++tx) { - children.emplace_front(child_z, tx, ty); + child_ids.emplace_front(child_z, tx, ty); } } - return children; + return child_ids; } Tile::ID Tile::ID::normalized() const { @@ -42,13 +42,13 @@ Tile::ID Tile::ID::normalized() const { return ID { z, nx, ny }; } -bool Tile::ID::isChildOf(const Tile::ID &parent) const { - if (parent.z >= z || parent.w != w) { +bool Tile::ID::isChildOf(const Tile::ID &parent_id) const { + if (parent_id.z >= z || parent_id.w != w) { return false; } - int32_t scale = std::pow(2, z - parent.z); - return parent.x == ((x < 0 ? x - scale + 1 : x) / scale) && - parent.y == y / scale; + int32_t scale = std::pow(2, z - parent_id.z); + return parent_id.x == ((x < 0 ? x - scale + 1 : x) / scale) && + parent_id.y == y / scale; } diff --git a/src/map/transform_state.cpp b/src/map/transform_state.cpp index fa521400c..0a858bce6 100644 --- a/src/map/transform_state.cpp +++ b/src/map/transform_state.cpp @@ -96,8 +96,8 @@ float TransformState::lngX(float lon) const { } float TransformState::latY(float lat) const { - float latY = 180 / M_PI * std::log(std::tan(M_PI / 4 + lat * M_PI / 360)); - return (180 - latY) * worldSize() / 360; + float lat_y = 180 / M_PI * std::log(std::tan(M_PI / 4 + lat * M_PI / 360)); + return (180 - lat_y) * worldSize() / 360; } std::array TransformState::locationCoordinate(float lon, float lat) const { diff --git a/src/map/vector_tile_data.cpp b/src/map/vector_tile_data.cpp index 48b46059a..b94bc66de 100644 --- a/src/map/vector_tile_data.cpp +++ b/src/map/vector_tile_data.cpp @@ -8,8 +8,8 @@ using namespace mbgl; -VectorTileData::VectorTileData(Tile::ID id, Map &map, const util::ptr &source) - : TileData(id, map, source), +VectorTileData::VectorTileData(Tile::ID id_, Map &map_, const util::ptr &source_) + : TileData(id_, map_, source_), depth(id.z >= source->max_zoom ? map.getMaxZoom() - id.z : 1) { } diff --git a/src/renderer/painter.cpp b/src/renderer/painter.cpp index aa522734c..38c2176ae 100644 --- a/src/renderer/painter.cpp +++ b/src/renderer/painter.cpp @@ -128,10 +128,10 @@ void Painter::useProgram(uint32_t program) { } } -void Painter::lineWidth(float lineWidth) { - if (gl_lineWidth != lineWidth) { - glLineWidth(lineWidth); - gl_lineWidth = lineWidth; +void Painter::lineWidth(float line_width) { + if (gl_lineWidth != line_width) { + glLineWidth(line_width); + gl_lineWidth = line_width; } } diff --git a/src/storage/file_source.cpp b/src/storage/file_source.cpp index 12d924416..70b4abe4c 100644 --- a/src/storage/file_source.cpp +++ b/src/storage/file_source.cpp @@ -27,12 +27,12 @@ FileSource::~FileSource() { // NOTE: We don't need to delete the messenger since it will be deleted by the // uv_messenger_stop() function. - util::ptr request; + util::ptr req; // Send a cancel() message to all requests that we are still holding. for (const std::pair> &pair : pending) { - if ((request = pair.second.lock())) { - request->cancel(); + if ((req = pair.second.lock())) { + req->cancel(); } } } @@ -61,25 +61,25 @@ std::unique_ptr FileSource::request(ResourceType type, const std::strin } }(); - util::ptr request; + util::ptr req; // First, try to find an existing Request object. auto it = pending.find(absoluteURL); if (it != pending.end()) { - request = it->second.lock(); + req = it->second.lock(); } - if (!request) { + if (!req) { if (absoluteURL.substr(0, 7) == "file://") { - request = std::make_shared(absoluteURL.substr(7), loop); + req = std::make_shared(absoluteURL.substr(7), loop); } else { - request = std::make_shared(type, absoluteURL, loop, store); + req = std::make_shared(type, absoluteURL, loop, store); } - pending.emplace(absoluteURL, request); + pending.emplace(absoluteURL, req); } - return std::unique_ptr(new Request(request)); + return std::unique_ptr(new Request(req)); } void FileSource::prepare(std::function fn) { @@ -93,10 +93,10 @@ void FileSource::prepare(std::function fn) { void FileSource::retryAllPending() { assert(thread_id == uv_thread_self()); - util::ptr request; + util::ptr req; for (const std::pair> &pair : pending) { - if ((request = pair.second.lock())) { - request->retryImmediately(); + if ((req = pair.second.lock())) { + req->retryImmediately(); } } diff --git a/src/storage/http_request.cpp b/src/storage/http_request.cpp index 3da4fc7c3..46b1d5e19 100644 --- a/src/storage/http_request.cpp +++ b/src/storage/http_request.cpp @@ -20,8 +20,8 @@ struct CacheRequestBaton { util::ptr store; }; -HTTPRequest::HTTPRequest(ResourceType type_, const std::string &path, uv_loop_t *loop_, util::ptr store_) - : BaseRequest(path), thread_id(uv_thread_self()), loop(loop_), store(store_), type(type_) { +HTTPRequest::HTTPRequest(ResourceType type_, const std::string &path_, uv_loop_t *loop_, util::ptr store_) + : BaseRequest(path_), thread_id(uv_thread_self()), loop(loop_), store(store_), type(type_) { if (store) { startCacheRequest(); } else { diff --git a/src/storage/response.cpp b/src/storage/response.cpp index cdaf33e4e..f1e1c3587 100644 --- a/src/storage/response.cpp +++ b/src/storage/response.cpp @@ -9,7 +9,7 @@ int64_t Response::parseCacheControl(const char *value) { uint64_t seconds = 0; // TODO: cache-control may contain other information as well: // http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9 - if (std::sscanf(value, "max-age=%llu", &seconds) == 1) { + if (std::sscanf(value, "max-age=%lu", &seconds) == 1) { return std::chrono::duration_cast( std::chrono::system_clock::now().time_since_epoch()).count() + seconds; diff --git a/src/style/style.cpp b/src/style/style.cpp index 6f0a0e3b2..aa5b15088 100644 --- a/src/style/style.cpp +++ b/src/style/style.cpp @@ -12,6 +12,7 @@ #include +#include namespace mbgl { diff --git a/src/style/style_parser.cpp b/src/style/style_parser.cpp index b2714f5da..47ff0c30a 100644 --- a/src/style/style_parser.cpp +++ b/src/style/style_parser.cpp @@ -6,6 +6,8 @@ #include #include +#include + namespace mbgl { using JSVal = const rapidjson::Value&; diff --git a/src/util/image.cpp b/src/util/image.cpp index ec218e0be..fd0d34de2 100644 --- a/src/util/image.cpp +++ b/src/util/image.cpp @@ -1,4 +1,5 @@ #include + #include #include diff --git a/src/util/raster.cpp b/src/util/raster.cpp index c4d7a1540..76cd41122 100644 --- a/src/util/raster.cpp +++ b/src/util/raster.cpp @@ -6,8 +6,6 @@ #include #include -#include - #include #include diff --git a/test/fixtures/fixture_log.cpp b/test/fixtures/fixture_log.cpp index c2c10fc9e..1b1646e66 100644 --- a/test/fixtures/fixture_log.cpp +++ b/test/fixtures/fixture_log.cpp @@ -9,25 +9,25 @@ FixtureLogBackend::~FixtureLogBackend() { } size_t FixtureLogBackend::count(const LogMessage &message) const { - size_t count = 0; + size_t message_count = 0; for (const LogMessage &msg : messages) { if (msg == message) { - count++; + message_count++; msg.checked = true; } } - return count; + return message_count; } std::vector FixtureLogBackend::unchecked() const { - std::vector unchecked; + std::vector unchecked_messages; for (const LogMessage &msg : messages) { if (!msg.checked) { - unchecked.push_back(msg); + unchecked_messages.push_back(msg); msg.checked = true; } } - return unchecked; + return unchecked_messages; } ::std::ostream& operator<<(::std::ostream& os, const std::vector& messages) { From 3b397c56ed2b851b07bca3a7c7d38cb0e7cb53f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Thu, 23 Oct 2014 03:30:05 -0700 Subject: [PATCH 2/6] print core dumps on application crashes --- .travis.yml | 5 +++++ scripts/run_tests.sh | 18 +++++++++++++++++- scripts/travis_before_install.sh | 2 +- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index bc714f77c..653b61037 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,6 +33,11 @@ before_install: install: - make config.gypi - ./scripts/travis_install_test_suite.sh +- ulimit -c + +before_script: + # Set the core file limit to unlimited so a core file is generated upon crash + - ulimit -c unlimited -S script: - ./scripts/travis_script.sh diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh index dd9ee3f26..e9952e46b 100755 --- a/scripts/run_tests.sh +++ b/scripts/run_tests.sh @@ -3,8 +3,24 @@ set -e set -o pipefail +# allow writing core files +ulimit -c unlimited -S + cd build/${BUILDTYPE:-Release} for TEST in ./test_* ; do - ${TEST} + RESULT=0 + ${TEST} || RESULT=$? + + # output core dump if we got one + for DUMP in $(find ./ -maxdepth 1 -name 'core*' -print); do + gdb ${TEST} ${DUMP} -ex "thread apply all bt" -ex "set pagination 0" -batch + rm -rf ${DUMP} + done + + # now we should present travis with the original + # error code so the run cleanly stops + if [[ ${RESULT} != 0 ]]; then + exit $RESULT + fi done diff --git a/scripts/travis_before_install.sh b/scripts/travis_before_install.sh index 1ecfc4f26..fefd6937f 100755 --- a/scripts/travis_before_install.sh +++ b/scripts/travis_before_install.sh @@ -19,7 +19,7 @@ if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then sudo apt-get -y install gcc-4.8 g++-4.8 mapbox_time "install_build_tools" \ - sudo apt-get -y install git build-essential zlib1g-dev automake \ + sudo apt-get -y install git build-essential zlib1g-dev automake gdb \ libtool xutils-dev make cmake pkg-config python-pip \ libboost1.55-dev libboost-regex1.55-dev libcurl4-openssl-dev \ libpng-dev libsqlite3-dev From 26e6ec20da4e85849d0688db5fd580056ebdfed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Thu, 23 Oct 2014 05:34:16 -0700 Subject: [PATCH 3/6] show that the program crashed --- scripts/run_tests.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh index e9952e46b..df0bf2521 100755 --- a/scripts/run_tests.sh +++ b/scripts/run_tests.sh @@ -3,15 +3,21 @@ set -e set -o pipefail -# allow writing core files -ulimit -c unlimited -S cd build/${BUILDTYPE:-Release} for TEST in ./test_* ; do + # allow writing core files + ulimit -c unlimited -S + RESULT=0 ${TEST} || RESULT=$? + if [[ ${RESULT} != 0 ]]; then + echo "The program crashed with exit code ${RESULT}. We're now trying to output the core dump." + ls -la + fi + # output core dump if we got one for DUMP in $(find ./ -maxdepth 1 -name 'core*' -print); do gdb ${TEST} ${DUMP} -ex "thread apply all bt" -ex "set pagination 0" -batch From 959d879f05da0e40270782e823435ca6946707ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Thu, 23 Oct 2014 06:16:13 -0700 Subject: [PATCH 4/6] show more debug information --- scripts/run_tests.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh index df0bf2521..fcd7fae09 100755 --- a/scripts/run_tests.sh +++ b/scripts/run_tests.sh @@ -2,20 +2,21 @@ set -e set -o pipefail - - +c cd build/${BUILDTYPE:-Release} for TEST in ./test_* ; do # allow writing core files ulimit -c unlimited -S + ulimit -c + cat /proc/sys/kernel/core_pattern + sysctl kernel.core_pattern RESULT=0 ${TEST} || RESULT=$? if [[ ${RESULT} != 0 ]]; then echo "The program crashed with exit code ${RESULT}. We're now trying to output the core dump." - ls -la fi # output core dump if we got one From ec73c369584315d91030faebc7e1a6e878c7e565 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Thu, 23 Oct 2014 06:22:08 -0700 Subject: [PATCH 5/6] fix typo --- scripts/run_tests.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh index fcd7fae09..6b42b7991 100755 --- a/scripts/run_tests.sh +++ b/scripts/run_tests.sh @@ -2,14 +2,14 @@ set -e set -o pipefail -c + cd build/${BUILDTYPE:-Release} for TEST in ./test_* ; do # allow writing core files ulimit -c unlimited -S - ulimit -c - cat /proc/sys/kernel/core_pattern + echo 'ulimit -c: '`ulimit -c` + echo '/proc/sys/kernel/core_pattern: '`cat /proc/sys/kernel/core_pattern` sysctl kernel.core_pattern RESULT=0 From cd44abcc588c9fc988589c148e76e4590c2197b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Thu, 23 Oct 2014 07:34:01 -0700 Subject: [PATCH 6/6] disable the thread sanitizer on clang/Debug for now since this prevents core dumps from being generated on segfaults --- scripts/flags.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/flags.sh b/scripts/flags.sh index 2b4624aa1..0b1f69ae1 100755 --- a/scripts/flags.sh +++ b/scripts/flags.sh @@ -16,17 +16,17 @@ if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then # but it's not worth a standalone matrix so here # we just test address->gcc and thread->clang for # some limited coverage - if [[ ${BUILDTYPE} == "Debug" ]]; then - if [[ ${CXX} == "g++" ]]; then - export CXXFLAGS="-fsanitize=address -g ${CXXFLAGS}" - export CFLAGS="-fsanitize=address -g ${CFLAGS}" - export LDFLAGS="-fsanitize=address ${LDFLAGS}" - elif [[ ${CXX} == "clang++" ]]; then - export CXXFLAGS="-fsanitize=thread -g -fPIC ${CXXFLAGS}" - export CFLAGS="-fsanitize=thread -g ${CFLAGS}" - export LDFLAGS="-fsanitize=thread -pie ${LDFLAGS}" - fi - fi + # if [[ ${BUILDTYPE} == "Debug" ]]; then + # if [[ ${CXX} == "g++" ]]; then + # export CXXFLAGS="-fsanitize=address -g ${CXXFLAGS}" + # export CFLAGS="-fsanitize=address -g ${CFLAGS}" + # export LDFLAGS="-fsanitize=address ${LDFLAGS}" + # elif [[ ${CXX} == "clang++" ]]; then + # export CXXFLAGS="-fsanitize=thread -g -fPIC ${CXXFLAGS}" + # export CFLAGS="-fsanitize=thread -g ${CFLAGS}" + # export LDFLAGS="-fsanitize=thread -pie ${LDFLAGS}" + # fi + # fi fi # turn off a few warnings