From 48dae7010e961cc61ac44a72fec9164f4d039112 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sun, 13 Sep 2020 23:12:02 +0800 Subject: [PATCH] rgw: convert string constant to string_view instead of converting string constant to char*, construct string_views from string constants to silence GCC warnings like: src/rgw/services/svc_sys_obj_cache.cc:512:7: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] 512 | { "cache list name=filter,type=CephString,req=false", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Kefu Chai --- src/rgw/services/svc_sys_obj_cache.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rgw/services/svc_sys_obj_cache.cc b/src/rgw/services/svc_sys_obj_cache.cc index bce50a115b5..5407dace4c6 100644 --- a/src/rgw/services/svc_sys_obj_cache.cc +++ b/src/rgw/services/svc_sys_obj_cache.cc @@ -508,7 +508,7 @@ static void cache_list_dump_helper(Formatter* f, class RGWSI_SysObj_Cache_ASocketHook : public AdminSocketHook { RGWSI_SysObj_Cache *svc; - static constexpr char* admin_commands[][2] = { + static constexpr std::string_view admin_commands[][2] = { { "cache list name=filter,type=CephString,req=false", "cache list [filter_str]: list object cache, possibly matching substrings" }, { "cache inspect name=target,type=CephString,req=true", -- 2.39.5