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

build: fix compilation errors on clang-10 #803

Merged
merged 1 commit into from
Mar 29, 2021
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
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/meta/test/meta_split_service_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ class meta_split_service_test : public meta_test_base
std::string path = app_root;

_ms->get_meta_storage()->create_node(
std::move(path), blob(lock_state, 0, strlen(lock_state)), [this, &app_root]() {
std::move(path), blob(lock_state, 0, strlen(lock_state)), [&app_root]() {
ddebug_f("create app root {}", app_root);
});
wait_all();
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