Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation fails due to -Werror=range-loop-construct #73

Closed
kannes opened this issue Sep 23, 2021 · 1 comment
Closed

Compilation fails due to -Werror=range-loop-construct #73

kannes opened this issue Sep 23, 2021 · 1 comment

Comments

@kannes
Copy link
Contributor

kannes commented Sep 23, 2021

$ cmake ..
-- The CXX compiler identification is GNU 11.1.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/untwine/build

$ make
[  5%] Building CXX object CMakeFiles/untwine.dir/bu/BuPyramid.cpp.o
[ 11%] Building CXX object CMakeFiles/untwine.dir/bu/CopcSupport.cpp.o
[ 17%] Building CXX object CMakeFiles/untwine.dir/bu/Processor.cpp.o
[ 23%] Building CXX object CMakeFiles/untwine.dir/bu/PyramidManager.cpp.o
[ 29%] Building CXX object CMakeFiles/untwine.dir/bu/Stats.cpp.o
[ 35%] Building CXX object CMakeFiles/untwine.dir/epf/BufferCache.cpp.o
[ 41%] Building CXX object CMakeFiles/untwine.dir/epf/Cell.cpp.o
[ 47%] Building CXX object CMakeFiles/untwine.dir/epf/Epf.cpp.o
/tmp/untwine/epf/Epf.cpp: In member function ‘untwine::PointCount untwine::epf::Epf::createFileInfo(const StringList&, untwine::StringList, std::vector<untwine::epf::FileInfo>&)’:
/tmp/untwine/epf/Epf.cpp:212:33: error: loop variable ‘xyz’ of type ‘const string&’ {aka ‘const std::__cxx11::basic_string<char>&’} binds to a temporary constructed from type ‘const char* const’ [-Werror=range-loop-construct]
  212 |         for (const std::string& xyz : { "X", "Y", "Z" })
      |                                 ^~~
/tmp/untwine/epf/Epf.cpp:212:33: note: use non-reference type ‘const string’ {aka ‘const std::__cxx11::basic_string<char>’} to make the copy explicit or ‘const char* const&’ to prevent copying
cc1plus: all warnings being treated as errors
make[2]: *** [CMakeFiles/untwine.dir/build.make:174: CMakeFiles/untwine.dir/epf/Epf.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/untwine.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
@kannes kannes changed the title Compoilation fails due to -Werror=range-loop-construct Compilation fails due to -Werror=range-loop-construct Sep 23, 2021
hobu added a commit that referenced this issue Sep 23, 2021
hobu added a commit that referenced this issue Sep 29, 2021
@kannes
Copy link
Contributor Author

kannes commented Sep 29, 2021

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants