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 <kchai@redhat.com>
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",