iso.cc:192:36: error: loop variable 'mount' of type 'const std::string&' {aka 'const std::__cxx11::basic_string<char>&'} binds to a temporary constructed from type 'const char* const' [-Werror=range-loop-construct]
Note that CMakeLists.txt
adds -Werror
which may be undesirable for releases.
...
[ 83%] Building CXX object ui/qt5/CMakeFiles/horizon-qt5.dir/partitionpage.cc.o
/horizon/image/backends/iso.cc: In member function 'virtual int Horizon::Image::CDBackend::prepare()':
/horizon/image/backends/iso.cc:192:36: warning: loop variable 'mount' of type 'const std::string&' {aka 'const std::__cxx11::basic_string<char>&'} binds to a temporary constructed from type 'const char* const' [-Wrange-loop-construct]
192 | for(const std::string &mount : {"dev", "proc", "sys"}) {
| ^~~~~
/horizon/image/backends/iso.cc:192:36: note: use non-reference type 'const std::string' {aka 'const std::__cxx11::basic_string<char>'} to make the copy explicit or 'const char* const&' to prevent copying
/horizon/image/backends/iso.cc: In member function 'virtual int Horizon::Image::CDBackend::create()':
/horizon/image/backends/iso.cc:281:32: warning: loop variable 'svc' of type 'const std::string&' {aka 'const std::__cxx11::basic_string<char>&'} binds to a temporary constructed from type 'const char* const' [-Wrange-loop-construct]
281 | for(const std::string &svc : {"udev", "udev-trigger", "lvmetad"}) {
| ^~~
/horizon/image/backends/iso.cc:281:32: note: use non-reference type 'const std::string' {aka 'const std::__cxx11::basic_string<char>'} to make the copy explicit or 'const char* const&' to prevent copying
...