From: Casey Bodley Date: Mon, 19 Jun 2023 19:16:53 +0000 (-0400) Subject: blkdev: fix nodiscard warning in get_device_metadata() X-Git-Tag: v19.0.0~528^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=be82a44b47aca31f659c3531ec6cfd1b3fe1b2ac;p=ceph-ci.git blkdev: fix nodiscard warning in get_device_metadata() [124/894] Building CXX object src/common/CMakeFiles/common-common-objs.dir/blkdev.cc.o /home/cbodley/ceph/src/common/blkdev.cc: In function ‘void get_device_metadata(const std::set >&, std::map, std::__cxx11::basic_string >*, std::map, std::__cxx11::basic_string >*)’: /home/cbodley/ceph/src/common/blkdev.cc:1189:71: warning: ignoring return value of ‘constexpr std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&) [with _CharT = char; _Traits = char_traits; _Alloc = allocator]’, declared with attribute ‘nodiscard’ [-Wunused-result] 1189 | (*errs)[dev] + " no unique device path for "s + dev + ": " + err; | ^ Signed-off-by: Casey Bodley --- diff --git a/src/common/blkdev.cc b/src/common/blkdev.cc index 6fc2965a19a..315e4f5e964 100644 --- a/src/common/blkdev.cc +++ b/src/common/blkdev.cc @@ -1186,7 +1186,7 @@ void get_device_metadata( } devpaths += dev + "=" + path; } else { - (*errs)[dev] + " no unique device path for "s + dev + ": " + err; + (*errs)[dev] += " no unique device path for "s + dev + ": " + err; } } }