]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
blkdev: fix nodiscard warning in get_device_metadata()
authorCasey Bodley <cbodley@redhat.com>
Mon, 19 Jun 2023 19:16:53 +0000 (15:16 -0400)
committerCasey Bodley <cbodley@redhat.com>
Mon, 19 Jun 2023 19:16:55 +0000 (15:16 -0400)
[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::__cxx11::basic_string<char> >&, std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >*, std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >*)’:
/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<char>; _Alloc = allocator<char>]’, declared with attribute ‘nodiscard’ [-Wunused-result]
 1189 |       (*errs)[dev] + " no unique device path for "s + dev + ": " + err;
      |                                                                       ^

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/common/blkdev.cc

index 6fc2965a19af2cfcbcb43794770c0b5808bc8194..315e4f5e964d4248c5de893da214579d5233423a 100644 (file)
@@ -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;
     }
   }
 }