Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

Commit

Permalink
build: fix compilation errors on clang-10 (#803)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wu Tao authored and neverchanje committed Mar 31, 2021
1 parent a7fa291 commit 3c81592
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions bin/dsn.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,12 @@ function(dsn_setup_compiler_flags)
# use frame pointers to allow simple stack frame walking for backtraces.
# This has a small perf hit but worth it for the ability to profile in production
add_compile_options( -fno-omit-frame-pointer)
# -Wno-deprecated-register
# kbr5.h uses the legacy 'register' keyword.
add_compile_options(-Wno-deprecated-register)
# -Wimplicit-int-float-conversion
# Poco/Dynamic/VarHolder.h uses 'unsigned long' to 'float' conversion
add_compile_options(-Wno-implicit-int-float-conversion)

find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
Expand Down
4 changes: 2 additions & 2 deletions src/http/pprof_http_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,9 +474,9 @@ void pprof_http_service::profile_handler(const http_request &req, http_response

useconds_t seconds = 60000000;

const char *req_url = req.full_url.to_string().data();
std::string req_url = req.full_url.to_string();
size_t len = req.full_url.length();
string_splitter url_sp(req_url, req_url + len, '?');
string_splitter url_sp(req_url.data(), req_url.data() + len, '?');
if (url_sp != NULL && ++url_sp != NULL) {
string_splitter param_sp(url_sp.field(), url_sp.field() + url_sp.length(), '&');
while (param_sp != NULL) {
Expand Down
4 changes: 2 additions & 2 deletions src/meta/test/meta_bulk_load_service_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class bulk_load_service_test : public meta_test_base
ainfo.app_id,
app_path,
dsn::enum_to_string(ainfo.status));
for (const auto kv : partition_bulk_load_info_map) {
for (const auto &kv : partition_bulk_load_info_map) {
mock_partition_bulk_load_info_on_remote_storage(gpid(ainfo.app_id, kv.first),
kv.second);
}
Expand Down Expand Up @@ -280,7 +280,7 @@ class bulk_load_service_test : public meta_test_base
int32_t get_partition_bulk_load_info_size(int32_t app_id)
{
int count = 0;
for (const auto kv : bulk_svc()._partition_bulk_load_info) {
for (const auto &kv : bulk_svc()._partition_bulk_load_info) {
if (kv.first.get_app_id() == app_id) {
++count;
}
Expand Down
2 changes: 1 addition & 1 deletion src/replica/replica.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class replica_disk_migrator;

class cold_backup_context;
typedef dsn::ref_ptr<cold_backup_context> cold_backup_context_ptr;
class cold_backup_metadata;
struct cold_backup_metadata;

namespace test {
class test_checker;
Expand Down

0 comments on commit 3c81592

Please sign in to comment.