diff options
author | Andrew Jeffery <andrew@aj.id.au> | 2018-05-24 13:05:30 +0930 |
---|---|---|
committer | Andrew Jeffery <andrew@aj.id.au> | 2019-03-18 15:27:04 +1030 |
commit | cd3b05e0b069f4407e4c0fa738c18cb0b0222b87 (patch) | |
tree | 4c87190c342fcaf340e9e140a376db0d533e36ad /controller.cpp | |
parent | c41bf5b7fdf4599101fe31e7d2e998aebfca7f92 (diff) | |
download | phosphor-led-sysfs-cd3b05e0b069f4407e4c0fa738c18cb0b0222b87.tar.gz phosphor-led-sysfs-cd3b05e0b069f4407e4c0fa738c18cb0b0222b87.zip |
controller: Avoid pessimistic moves
clang-6.0 reports that some of the moves prevent further optimisations, so
remove them.
$ make
make all-am
make[1]: Entering directory '/home/andrew/src/openbmc/phosphor-led-sysfs'
CXX controller.o
controller.cpp:60:12: error: moving a temporary object prevents copy elision [-Werror,-Wpessimizing-move]
path = std::move(DEVPATH + name);
^
controller.cpp:60:12: note: remove std::move call here
path = std::move(DEVPATH + name);
^~~~~~~~~~ ~
controller.cpp:75:16: error: moving a temporary object prevents copy elision [-Werror,-Wpessimizing-move]
auto bus = std::move(sdbusplus::bus::new_default());
^
controller.cpp:75:16: note: remove std::move call here
auto bus = std::move(sdbusplus::bus::new_default());
^~~~~~~~~~ ~
2 errors generated.
Makefile:761: recipe for target 'controller.o' failed
make[1]: *** [controller.o] Error 1
make[1]: Leaving directory '/home/andrew/src/openbmc/phosphor-led-sysfs'
Makefile:617: recipe for target 'all' failed
make: *** [all] Error 2
Change-Id: I3da6415def4ab183cc9f6c5e176e8bb3666cf1b7
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Diffstat (limited to 'controller.cpp')
-rw-r--r-- | controller.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/controller.cpp b/controller.cpp index f945034..02120e2 100644 --- a/controller.cpp +++ b/controller.cpp @@ -59,7 +59,7 @@ int main(int argc, char** argv) // LED names may have a hyphen and that would be an issue for // dbus paths and hence need to convert them to underscores. std::replace(name.begin(), name.end(), '/', '-'); - path = std::move(DEVPATH + name); + path = DEVPATH + name; // Convert to lowercase just in case some are not and that // we follow lowercase all over @@ -74,7 +74,7 @@ int main(int argc, char** argv) auto objPath = std::string(OBJPATH) + '/' + name; // Get a handle to system dbus. - auto bus = std::move(sdbusplus::bus::new_default()); + auto bus = sdbusplus::bus::new_default(); // Add systemd object manager. sdbusplus::server::manager::manager(bus, objPath.c_str()); |