From: Kefu Chai Date: Sun, 13 Sep 2020 15:12:02 +0000 (+0800) Subject: rgw: convert string constant to string_view X-Git-Tag: v16.1.0~1101^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F37125%2Fhead;p=ceph.git 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 --- diff --git a/src/rgw/services/svc_sys_obj_cache.cc b/src/rgw/services/svc_sys_obj_cache.cc index bce50a115b5a..5407dace4c65 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",