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

PDAL 1.7.1 fails to build on various architectures (-Werror=shift-count-overflow, -Werror=cast-align, -Werror=cast-qual) #1915

Closed
sebastic opened this issue Apr 9, 2018 · 13 comments
Milestone

Comments

@sebastic
Copy link
Contributor

sebastic commented Apr 9, 2018

PDAL 1.71. fails to build on various architectures: buildlogs

i386

cd /<<PKGBUILDDIR>>/obj-i686-linux-gnu/vendor/arbiter && /usr/bin/c++  -DARBITER_CURL -DUNIX -I/<<PKGBUILDDIR>>/vendor/gtest/include -I/<<PKGBUILDDIR>>/vendor/gtest -I/<<PKGBUILDDIR>> -I/usr/include/gdal -I/usr/include/geotiff -I/usr/include/jsoncpp -I/usr/include/i386-linux-gnu -isystem /usr/local/include  -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wno-error=maybe-uninitialized -Wdate-time -D_FORTIFY_SOURCE=2 -O2 -g -DNDEBUG   -std=c++11 -Wno-implicit-fallthrough -Wno-int-in-bool-context -Wno-dangling-else -Wno-noexcept-type -Wextra -Wpedantic -Werror -Wall -Wno-unused-parameter -Wno-unused-variable -Wpointer-arith -Wcast-align -Wcast-qual -Wredundant-decls -Wno-long-long -Wno-unknown-pragmas -Wno-deprecated-declarations -fPIC -o CMakeFiles/pdal_arbiter.dir/arbiter.cpp.o -c /<<PKGBUILDDIR>>/vendor/arbiter/arbiter.cpp
/<<PKGBUILDDIR>>/vendor/arbiter/arbiter.cpp: In function 'void pdal::arbiter::crypto::{anonymous}::sha256_final(pdal::arbiter::crypto::{anonymous}::Sha256Context*, uint8_t*)':
/<<PKGBUILDDIR>>/vendor/arbiter/arbiter.cpp:4228:36: error: right shift count >= width of type [-Werror=shift-count-overflow]
     ctx->data[59] = ctx->bitlen >> 32;
                                    ^~
/<<PKGBUILDDIR>>/vendor/arbiter/arbiter.cpp:4229:36: error: right shift count >= width of type [-Werror=shift-count-overflow]
     ctx->data[58] = ctx->bitlen >> 40;
                                    ^~
/<<PKGBUILDDIR>>/vendor/arbiter/arbiter.cpp:4230:36: error: right shift count >= width of type [-Werror=shift-count-overflow]
     ctx->data[57] = ctx->bitlen >> 48;
                                    ^~
/<<PKGBUILDDIR>>/vendor/arbiter/arbiter.cpp:4231:36: error: right shift count >= width of type [-Werror=shift-count-overflow]
     ctx->data[56] = ctx->bitlen >> 56;
                                    ^~
cc1plus: all warnings being treated as errors

arm64

/usr/bin/c++  -DUNIX -Dpdal_base_EXPORTS -I/<<PKGBUILDDIR>>/vendor/gtest/include -I/<<PKGBUILDDIR>>/vendor/gtest -I/<<PKGBUILDDIR>> -I/<<PKGBUILDDIR>>/obj-aarch64-linux-gnu/include -I/<<PKGBUILDDIR>>/vendor -I/<<PKGBUILDDIR>>/vendor/eigen -I/<<PKGBUILDDIR>>/vendor/pdalboost -I/usr/include/gdal -I/usr/include/geotiff -I/usr/include/jsoncpp -I/usr/include/aarch64-linux-gnu -isystem /usr/local/include -I/usr/include/libxml2  -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wno-error=maybe-uninitialized -Wdate-time -D_FORTIFY_SOURCE=2 -O2 -g -DNDEBUG -fPIC   -std=c++11 -Wno-implicit-fallthrough -Wno-int-in-bool-context -Wno-dangling-else -Wno-noexcept-type -Wextra -Wpedantic -Werror -Wall -Wno-unused-parameter -Wno-unused-variable -Wpointer-arith -Wcast-align -Wcast-qual -Wredundant-decls -Wno-long-long -Wno-unknown-pragmas -Wno-deprecated-declarations -o CMakeFiles/pdal_base.dir/filters/ApproximateCoplanarFilter.cpp.o -c /<<PKGBUILDDIR>>/filters/ApproximateCoplanarFilter.cpp
In file included from /<<PKGBUILDDIR>>/vendor/eigen/Eigen/Core:382:0,
                 from /<<PKGBUILDDIR>>/vendor/eigen/Eigen/Dense:1,
                 from /<<PKGBUILDDIR>>/pdal/EigenUtils.hpp:41,
                 from /<<PKGBUILDDIR>>/filters/ApproximateCoplanarFilter.cpp:37:
/<<PKGBUILDDIR>>/vendor/eigen/Eigen/src/Core/arch/NEON/Complex.h: In function 'Packet Eigen::internal::pset1(const typename Eigen::internal::unpacket_traits<Packet>::type&) [with Packet = Eigen::internal::Packet2cf; typename Eigen::internal::unpacket_traits<Packet>::type = std::complex<float>]':
/<<PKGBUILDDIR>>/vendor/eigen/Eigen/src/Core/arch/NEON/Complex.h:70:28: error: cast from type 'const std::complex<float>*' to type 'float*' casts away qualifiers [-Werror=cast-qual]
   r64 = vld1_f32((float *)&from);
                            ^~~~
In file included from /<<PKGBUILDDIR>>/vendor/eigen/Eigen/Core:380:0,
                 from /<<PKGBUILDDIR>>/vendor/eigen/Eigen/Dense:1,
                 from /<<PKGBUILDDIR>>/pdal/EigenUtils.hpp:41,
                 from /<<PKGBUILDDIR>>/filters/ApproximateCoplanarFilter.cpp:37:
/<<PKGBUILDDIR>>/vendor/eigen/Eigen/src/Core/arch/NEON/Complex.h: In function 'void Eigen::internal::prefetch(const Scalar*) [with Scalar = std::complex<float>]':
/<<PKGBUILDDIR>>/vendor/eigen/Eigen/src/Core/arch/NEON/Complex.h:145:134: error: cast from type 'const std::complex<float>*' to type 'float*' casts away qualifiers [-Werror=cast-qual]
 template<> EIGEN_STRONG_INLINE void prefetch<std::complex<float> >(const std::complex<float> *   addr) { EIGEN_ARM_PREFETCH((float *)addr); }
                                                                                                                                      ^
/<<PKGBUILDDIR>>/vendor/eigen/Eigen/src/Core/arch/NEON/PacketMath.h:58:101: note: in definition of macro 'EIGEN_ARM_PREFETCH'
   #define EIGEN_ARM_PREFETCH(ADDR)  __asm__ __volatile__("prfm pldl1keep, [%[addr]]\n" ::[addr] "r"(ADDR) : );
                                                                                                     ^~~~
/<<PKGBUILDDIR>>/vendor/eigen/Eigen/src/Core/arch/NEON/Complex.h: In function 'void Eigen::internal::prefetch(const Scalar*) [with Scalar = std::complex<double>]':
/<<PKGBUILDDIR>>/vendor/eigen/Eigen/src/Core/arch/NEON/Complex.h:384:137: error: cast from type 'const std::complex<double>*' to type 'double*' casts away qualifiers [-Werror=cast-qual]
 template<> EIGEN_STRONG_INLINE void prefetch<std::complex<double> >(const std::complex<double> *   addr) { EIGEN_ARM_PREFETCH((double *)addr); }
                                                                                                                                         ^
/<<PKGBUILDDIR>>/vendor/eigen/Eigen/src/Core/arch/NEON/PacketMath.h:58:101: note: in definition of macro 'EIGEN_ARM_PREFETCH'
   #define EIGEN_ARM_PREFETCH(ADDR)  __asm__ __volatile__("prfm pldl1keep, [%[addr]]\n" ::[addr] "r"(ADDR) : );
                                                                                                     ^~~~
cc1plus: all warnings being treated as errors
...
/usr/bin/c++  -DUNIX -Dpdal_base_EXPORTS -I/<<PKGBUILDDIR>>/vendor/gtest/include -I/<<PKGBUILDDIR>>/vendor/gtest -I/<<PKGBUILDDIR>> -I/<<PKGBUILDDIR>>/obj-aarch64-linux-gnu/include -I/<<PKGBUILDDIR>>/vendor -I/<<PKGBUILDDIR>>/vendor/eigen -I/<<PKGBUILDDIR>>/vendor/pdalboost -I/usr/include/gdal -I/usr/include/geotiff -I/usr/include/jsoncpp -I/usr/include/aarch64-linux-gnu -isystem /usr/local/include -I/usr/include/libxml2  -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wno-error=maybe-uninitialized -Wdate-time -D_FORTIFY_SOURCE=2 -O2 -g -DNDEBUG -fPIC   -std=c++11 -Wno-implicit-fallthrough -Wno-int-in-bool-context -Wno-dangling-else -Wno-noexcept-type -Wextra -Wpedantic -Werror -Wall -Wno-unused-parameter -Wno-unused-variable -Wpointer-arith -Wcast-align -Wcast-qual -Wredundant-decls -Wno-long-long -Wno-unknown-pragmas -Wno-deprecated-declarations -o CMakeFiles/pdal_base.dir/filters/EigenvaluesFilter.cpp.o -c /<<PKGBUILDDIR>>/filters/EigenvaluesFilter.cpp
In file included from /<<PKGBUILDDIR>>/vendor/eigen/Eigen/Core:382:0,
                 from /<<PKGBUILDDIR>>/vendor/eigen/Eigen/Dense:1,
                 from /<<PKGBUILDDIR>>/pdal/EigenUtils.hpp:41,
                 from /<<PKGBUILDDIR>>/filters/EigenvaluesFilter.cpp:37:
/<<PKGBUILDDIR>>/vendor/eigen/Eigen/src/Core/arch/NEON/Complex.h: In function 'Packet Eigen::internal::pset1(const typename Eigen::internal::unpacket_traits<Packet>::type&) [with Packet = Eigen::internal::Packet2cf; typename Eigen::internal::unpacket_traits<Packet>::type = std::complex<float>]':
/<<PKGBUILDDIR>>/vendor/eigen/Eigen/src/Core/arch/NEON/Complex.h:70:28: error: cast from type 'const std::complex<float>*' to type 'float*' casts away qualifiers [-Werror=cast-qual]
   r64 = vld1_f32((float *)&from);
                            ^~~~
In file included from /<<PKGBUILDDIR>>/vendor/eigen/Eigen/Core:380:0,
                 from /<<PKGBUILDDIR>>/vendor/eigen/Eigen/Dense:1,
                 from /<<PKGBUILDDIR>>/pdal/EigenUtils.hpp:41,
                 from /<<PKGBUILDDIR>>/filters/EigenvaluesFilter.cpp:37:
/<<PKGBUILDDIR>>/vendor/eigen/Eigen/src/Core/arch/NEON/Complex.h: In function 'void Eigen::internal::prefetch(const Scalar*) [with Scalar = std::complex<float>]':
/<<PKGBUILDDIR>>/vendor/eigen/Eigen/src/Core/arch/NEON/Complex.h:145:134: error: cast from type 'const std::complex<float>*' to type 'float*' casts away qualifiers [-Werror=cast-qual]
 template<> EIGEN_STRONG_INLINE void prefetch<std::complex<float> >(const std::complex<float> *   addr) { EIGEN_ARM_PREFETCH((float *)addr); }
                                                                                                                                      ^
/<<PKGBUILDDIR>>/vendor/eigen/Eigen/src/Core/arch/NEON/PacketMath.h:58:101: note: in definition of macro 'EIGEN_ARM_PREFETCH'
   #define EIGEN_ARM_PREFETCH(ADDR)  __asm__ __volatile__("prfm pldl1keep, [%[addr]]\n" ::[addr] "r"(ADDR) : );
                                                                                                     ^~~~
/<<PKGBUILDDIR>>/vendor/eigen/Eigen/src/Core/arch/NEON/Complex.h: In function 'void Eigen::internal::prefetch(const Scalar*) [with Scalar = std::complex<double>]':
/<<PKGBUILDDIR>>/vendor/eigen/Eigen/src/Core/arch/NEON/Complex.h:384:137: error: cast from type 'const std::complex<double>*' to type 'double*' casts away qualifiers [-Werror=cast-qual]
 template<> EIGEN_STRONG_INLINE void prefetch<std::complex<double> >(const std::complex<double> *   addr) { EIGEN_ARM_PREFETCH((double *)addr); }
                                                                                                                                         ^
/<<PKGBUILDDIR>>/vendor/eigen/Eigen/src/Core/arch/NEON/PacketMath.h:58:101: note: in definition of macro 'EIGEN_ARM_PREFETCH'
   #define EIGEN_ARM_PREFETCH(ADDR)  __asm__ __volatile__("prfm pldl1keep, [%[addr]]\n" ::[addr] "r"(ADDR) : );
                                                                                                     ^~~~
cc1plus: all warnings being treated as errors

mips

make[4]: Entering directory '/<<PKGBUILDDIR>>/obj-mips-linux-gnu'
cd /<<PKGBUILDDIR>>/obj-mips-linux-gnu/vendor/pdalboost && /usr/bin/c++  -DBOOST_SYSTEM_NO_DEPRECATED -DUNIX -I/<<PKGBUILDDIR>>/vendor/gtest/include -I/<<PKGBUILDDIR>>/vendor/gtest -I/<<PKGBUILDDIR>> -I/<<PKGBUILDDIR>>/vendor/pdalboost -I/usr/include/gdal -I/usr/include/geotiff -I/usr/include/jsoncpp -I/usr/include/mips-linux-gnu -isystem /usr/local/include  -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wno-error=maybe-uninitialized -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -O2 -g -DNDEBUG   -std=c++11 -Wno-implicit-fallthrough -Wno-int-in-bool-context -Wno-dangling-else -Wno-noexcept-type -Wextra -Wpedantic -Werror -Wall -Wno-unused-parameter -Wno-unused-variable -Wpointer-arith -Wcast-align -Wcast-qual -Wredundant-decls -Wno-long-long -Wno-unknown-pragmas -Wno-deprecated-declarations -o CMakeFiles/pdal_boost.dir/libs/filesystem/src/operations.cpp.o -c /<<PKGBUILDDIR>>/vendor/pdalboost/libs/filesystem/src/operations.cpp
In file included from /<<PKGBUILDDIR>>/vendor/pdalboost/boost/utility/addressof.hpp:15:0,
                 from /<<PKGBUILDDIR>>/vendor/pdalboost/boost/iterator/iterator_facade.hpp:20,
                 from /<<PKGBUILDDIR>>/vendor/pdalboost/boost/filesystem/path.hpp:28,
                 from /<<PKGBUILDDIR>>/vendor/pdalboost/boost/filesystem/operations.hpp:25,
                 from /<<PKGBUILDDIR>>/vendor/pdalboost/libs/filesystem/src/operations.cpp:44:
/<<PKGBUILDDIR>>/vendor/pdalboost/boost/core/addressof.hpp: In instantiation of 'static T* pdalboost::detail::addressof_impl<T>::f(T&, long int) [with T = pdalboost::filesystem::directory_entry]':
/<<PKGBUILDDIR>>/vendor/pdalboost/boost/core/addressof.hpp:116:51:   required from 'T* pdalboost::addressof(T&) [with T = pdalboost::filesystem::directory_entry]'
/<<PKGBUILDDIR>>/vendor/pdalboost/boost/iterator/iterator_facade.hpp:345:40:   required from 'static pdalboost::iterators::detail::operator_arrow_dispatch<T&, Pointer>::result_type pdalboost::iterators::detail::operator_arrow_dispatch<T&, Pointer>::apply(T&) [with T = pdalboost::filesystem::directory_entry; Pointer = pdalboost::filesystem::directory_entry*; pdalboost::iterators::detail::operator_arrow_dispatch<T&, Pointer>::result_type = pdalboost::filesystem::directory_entry*]'
/<<PKGBUILDDIR>>/vendor/pdalboost/boost/iterator/iterator_facade.hpp:660:51:   required from 'pdalboost::iterators::detail::iterator_facade_base<Derived, Value, CategoryOrTraversal, Reference, Difference, false, false>::pointer pdalboost::iterators::detail::iterator_facade_base<Derived, Value, CategoryOrTraversal, Reference, Difference, false, false>::operator->() const [with Derived = pdalboost::filesystem::directory_iterator; Value = pdalboost::filesystem::directory_entry; CategoryOrTraversal = pdalboost::iterators::single_pass_traversal_tag; Reference = pdalboost::filesystem::directory_entry&; Difference = int; pdalboost::iterators::detail::iterator_facade_base<Derived, Value, CategoryOrTraversal, Reference, Difference, false, false>::pointer = pdalboost::filesystem::directory_entry*]'
/<<PKGBUILDDIR>>/vendor/pdalboost/boost/filesystem/operations.hpp:1048:39:   required from here
/<<PKGBUILDDIR>>/vendor/pdalboost/boost/core/addressof.hpp:40:16: error: cast from 'char*' to 'pdalboost::filesystem::directory_entry*' increases required alignment of target type [-Werror=cast-align]
         return reinterpret_cast<T*>(
                ^~~~~~~~~~~~~~~~~~~~~
             &const_cast<char&>(reinterpret_cast<const volatile char &>(v)));
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/<<PKGBUILDDIR>>/vendor/pdalboost/boost/core/addressof.hpp: In instantiation of 'static T* pdalboost::detail::addressof_impl<T>::f(T&, long int) [with T = const pdalboost::filesystem::path]':
/<<PKGBUILDDIR>>/vendor/pdalboost/boost/core/addressof.hpp:116:51:   required from 'T* pdalboost::addressof(T&) [with T = const pdalboost::filesystem::path]'
/<<PKGBUILDDIR>>/vendor/pdalboost/boost/iterator/iterator_facade.hpp:345:40:   required from 'static pdalboost::iterators::detail::operator_arrow_dispatch<T&, Pointer>::result_type pdalboost::iterators::detail::operator_arrow_dispatch<T&, Pointer>::apply(T&) [with T = const pdalboost::filesystem::path; Pointer = const pdalboost::filesystem::path*; pdalboost::iterators::detail::operator_arrow_dispatch<T&, Pointer>::result_type = const pdalboost::filesystem::path*]'
/<<PKGBUILDDIR>>/vendor/pdalboost/boost/iterator/iterator_facade.hpp:660:51:   required from 'pdalboost::iterators::detail::iterator_facade_base<Derived, Value, CategoryOrTraversal, Reference, Difference, false, false>::pointer pdalboost::iterators::detail::iterator_facade_base<Derived, Value, CategoryOrTraversal, Reference, Difference, false, false>::operator->() const [with Derived = pdalboost::filesystem::path::iterator; Value = const pdalboost::filesystem::path; CategoryOrTraversal = pdalboost::iterators::bidirectional_traversal_tag; Reference = const pdalboost::filesystem::path&; Difference = int; pdalboost::iterators::detail::iterator_facade_base<Derived, Value, CategoryOrTraversal, Reference, Difference, false, false>::pointer = const pdalboost::filesystem::path*]'
/<<PKGBUILDDIR>>/vendor/pdalboost/libs/filesystem/src/operations.cpp:1915:14:   required from here
/<<PKGBUILDDIR>>/vendor/pdalboost/boost/core/addressof.hpp:40:16: error: cast from 'char*' to 'const pdalboost::filesystem::path*' increases required alignment of target type [-Werror=cast-align]
cc1plus: all warnings being treated as errors
...
make[4]: Entering directory '/<<PKGBUILDDIR>>/obj-mips-linux-gnu'
cd /<<PKGBUILDDIR>>/obj-mips-linux-gnu/vendor/pdalboost && /usr/bin/c++  -DBOOST_SYSTEM_NO_DEPRECATED -DUNIX -I/<<PKGBUILDDIR>>/vendor/gtest/include -I/<<PKGBUILDDIR>>/vendor/gtest -I/<<PKGBUILDDIR>> -I/<<PKGBUILDDIR>>/vendor/pdalboost -I/usr/include/gdal -I/usr/include/geotiff -I/usr/include/jsoncpp -I/usr/include/mips-linux-gnu -isystem /usr/local/include  -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wno-error=maybe-uninitialized -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -O2 -g -DNDEBUG   -std=c++11 -Wno-implicit-fallthrough -Wno-int-in-bool-context -Wno-dangling-else -Wno-noexcept-type -Wextra -Wpedantic -Werror -Wall -Wno-unused-parameter -Wno-unused-variable -Wpointer-arith -Wcast-align -Wcast-qual -Wredundant-decls -Wno-long-long -Wno-unknown-pragmas -Wno-deprecated-declarations -o CMakeFiles/pdal_boost.dir/libs/filesystem/src/path.cpp.o -c /<<PKGBUILDDIR>>/vendor/pdalboost/libs/filesystem/src/path.cpp
In file included from /<<PKGBUILDDIR>>/vendor/pdalboost/boost/utility/addressof.hpp:15:0,
                 from /<<PKGBUILDDIR>>/vendor/pdalboost/boost/iterator/iterator_facade.hpp:20,
                 from /<<PKGBUILDDIR>>/vendor/pdalboost/boost/filesystem/path.hpp:28,
                 from /<<PKGBUILDDIR>>/vendor/pdalboost/libs/filesystem/src/path.cpp:26:
/<<PKGBUILDDIR>>/vendor/pdalboost/boost/core/addressof.hpp: In instantiation of 'static T* pdalboost::detail::addressof_impl<T>::f(T&, long int) [with T = pdalboost::filesystem::directory_entry]':
/<<PKGBUILDDIR>>/vendor/pdalboost/boost/core/addressof.hpp:116:51:   required from 'T* pdalboost::addressof(T&) [with T = pdalboost::filesystem::directory_entry]'
/<<PKGBUILDDIR>>/vendor/pdalboost/boost/iterator/iterator_facade.hpp:345:40:   required from 'static pdalboost::iterators::detail::operator_arrow_dispatch<T&, Pointer>::result_type pdalboost::iterators::detail::operator_arrow_dispatch<T&, Pointer>::apply(T&) [with T = pdalboost::filesystem::directory_entry; Pointer = pdalboost::filesystem::directory_entry*; pdalboost::iterators::detail::operator_arrow_dispatch<T&, Pointer>::result_type = pdalboost::filesystem::directory_entry*]'
/<<PKGBUILDDIR>>/vendor/pdalboost/boost/iterator/iterator_facade.hpp:660:51:   required from 'pdalboost::iterators::detail::iterator_facade_base<Derived, Value, CategoryOrTraversal, Reference, Difference, false, false>::pointer pdalboost::iterators::detail::iterator_facade_base<Derived, Value, CategoryOrTraversal, Reference, Difference, false, false>::operator->() const [with Derived = pdalboost::filesystem::directory_iterator; Value = pdalboost::filesystem::directory_entry; CategoryOrTraversal = pdalboost::iterators::single_pass_traversal_tag; Reference = pdalboost::filesystem::directory_entry&; Difference = int; pdalboost::iterators::detail::iterator_facade_base<Derived, Value, CategoryOrTraversal, Reference, Difference, false, false>::pointer = pdalboost::filesystem::directory_entry*]'
/<<PKGBUILDDIR>>/vendor/pdalboost/boost/filesystem/operations.hpp:1048:39:   required from here
/<<PKGBUILDDIR>>/vendor/pdalboost/boost/core/addressof.hpp:40:16: error: cast from 'char*' to 'pdalboost::filesystem::directory_entry*' increases required alignment of target type [-Werror=cast-align]
         return reinterpret_cast<T*>(
                ^~~~~~~~~~~~~~~~~~~~~
             &const_cast<char&>(reinterpret_cast<const volatile char &>(v)));
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/<<PKGBUILDDIR>>/vendor/pdalboost/boost/core/addressof.hpp: In instantiation of 'static T* pdalboost::detail::addressof_impl<T>::f(T&, long int) [with T = const pdalboost::filesystem::path]':
/<<PKGBUILDDIR>>/vendor/pdalboost/boost/core/addressof.hpp:116:51:   required from 'T* pdalboost::addressof(T&) [with T = const pdalboost::filesystem::path]'
/<<PKGBUILDDIR>>/vendor/pdalboost/boost/iterator/iterator_facade.hpp:345:40:   required from 'static pdalboost::iterators::detail::operator_arrow_dispatch<T&, Pointer>::result_type pdalboost::iterators::detail::operator_arrow_dispatch<T&, Pointer>::apply(T&) [with T = const pdalboost::filesystem::path; Pointer = const pdalboost::filesystem::path*; pdalboost::iterators::detail::operator_arrow_dispatch<T&, Pointer>::result_type = const pdalboost::filesystem::path*]'
/<<PKGBUILDDIR>>/vendor/pdalboost/boost/iterator/iterator_facade.hpp:660:51:   required from 'pdalboost::iterators::detail::iterator_facade_base<Derived, Value, CategoryOrTraversal, Reference, Difference, false, false>::pointer pdalboost::iterators::detail::iterator_facade_base<Derived, Value, CategoryOrTraversal, Reference, Difference, false, false>::operator->() const [with Derived = pdalboost::filesystem::path::iterator; Value = const pdalboost::filesystem::path; CategoryOrTraversal = pdalboost::iterators::bidirectional_traversal_tag; Reference = const pdalboost::filesystem::path&; Difference = int; pdalboost::iterators::detail::iterator_facade_base<Derived, Value, CategoryOrTraversal, Reference, Difference, false, false>::pointer = const pdalboost::filesystem::path*]'
/<<PKGBUILDDIR>>/vendor/pdalboost/libs/filesystem/src/path.cpp:440:14:   required from here
/<<PKGBUILDDIR>>/vendor/pdalboost/boost/core/addressof.hpp:40:16: error: cast from 'char*' to 'const pdalboost::filesystem::path*' increases required alignment of target type [-Werror=cast-align]
cc1plus: all warnings being treated as errors
make[4]: *** [vendor/pdalboost/CMakeFiles/pdal_boost.dir/build.make:138: vendor/pdalboost/CMakeFiles/pdal_boost.dir/libs/filesystem/src/path.cpp.o] Error 1
make[4]: Leaving directory '/<<PKGBUILDDIR>>/obj-mips-linux-gnu'
make[3]: *** [CMakeFiles/Makefile2:4333: vendor/pdalboost/CMakeFiles/pdal_boost.dir/all] Error 2
make[3]: *** Waiting for unfinished jobs....
make[4]: Entering directory '/<<PKGBUILDDIR>>/obj-mips-linux-gnu'
cd /<<PKGBUILDDIR>>/obj-mips-linux-gnu/vendor/arbiter && /usr/bin/c++  -DARBITER_CURL -DUNIX -I/<<PKGBUILDDIR>>/vendor/gtest/include -I/<<PKGBUILDDIR>>/vendor/gtest -I/<<PKGBUILDDIR>> -I/usr/include/gdal -I/usr/include/geotiff -I/usr/include/jsoncpp -I/usr/include/mips-linux-gnu -isystem /usr/local/include  -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wno-error=maybe-uninitialized -Wdate-time -D_FORTIFY_SOURCE=2 -O2 -g -DNDEBUG   -std=c++11 -Wno-implicit-fallthrough -Wno-int-in-bool-context -Wno-dangling-else -Wno-noexcept-type -Wextra -Wpedantic -Werror -Wall -Wno-unused-parameter -Wno-unused-variable -Wpointer-arith -Wcast-align -Wcast-qual -Wredundant-decls -Wno-long-long -Wno-unknown-pragmas -Wno-deprecated-declarations -fPIC -o CMakeFiles/pdal_arbiter.dir/arbiter.cpp.o -c /<<PKGBUILDDIR>>/vendor/arbiter/arbiter.cpp
/<<PKGBUILDDIR>>/vendor/arbiter/arbiter.cpp: In function 'void pdal::arbiter::crypto::{anonymous}::sha256_final(pdal::arbiter::crypto::{anonymous}::Sha256Context*, uint8_t*)':
/<<PKGBUILDDIR>>/vendor/arbiter/arbiter.cpp:4228:36: error: right shift count >= width of type [-Werror=shift-count-overflow]
     ctx->data[59] = ctx->bitlen >> 32;
                                    ^~
/<<PKGBUILDDIR>>/vendor/arbiter/arbiter.cpp:4229:36: error: right shift count >= width of type [-Werror=shift-count-overflow]
     ctx->data[58] = ctx->bitlen >> 40;
                                    ^~
/<<PKGBUILDDIR>>/vendor/arbiter/arbiter.cpp:4230:36: error: right shift count >= width of type [-Werror=shift-count-overflow]
     ctx->data[57] = ctx->bitlen >> 48;
                                    ^~
/<<PKGBUILDDIR>>/vendor/arbiter/arbiter.cpp:4231:36: error: right shift count >= width of type [-Werror=shift-count-overflow]
     ctx->data[56] = ctx->bitlen >> 56;
                                    ^~
In file included from /<<PKGBUILDDIR>>/vendor/arbiter/arbiter.cpp:43:0:
/<<PKGBUILDDIR>>/vendor/arbiter/arbiter.hpp: In instantiation of 'void* rapidxml::memory_pool<Ch>::allocate_aligned(std::size_t) [with Ch = char; std::size_t = unsigned int]':
/<<PKGBUILDDIR>>/vendor/arbiter/arbiter.hpp:1510:44:   required from 'rapidxml::xml_node<Ch>* rapidxml::memory_pool<Ch>::allocate_node(rapidxml::node_type, const Ch*, const Ch*, std::size_t, std::size_t) [with Ch = char; std::size_t = unsigned int]'
/<<PKGBUILDDIR>>/vendor/arbiter/arbiter.hpp:3131:27:   required from 'rapidxml::xml_node<Ch>* rapidxml::xml_document<Ch>::parse_element(Ch*&) [with int Flags = 0; Ch = char]'
/<<PKGBUILDDIR>>/vendor/arbiter/arbiter.hpp:3181:44:   required from 'rapidxml::xml_node<Ch>* rapidxml::xml_document<Ch>::parse_node(Ch*&) [with int Flags = 0; Ch = char]'
/<<PKGBUILDDIR>>/vendor/arbiter/arbiter.hpp:2495:63:   required from 'void rapidxml::xml_document<Ch>::parse(Ch*) [with int Flags = 0; Ch = char]'
/<<PKGBUILDDIR>>/vendor/arbiter/arbiter.cpp:2033:37:   required from here
/<<PKGBUILDDIR>>/vendor/arbiter/arbiter.hpp:1709:38: error: cast from 'char*' to 'rapidxml::memory_pool<char>::header*' increases required alignment of target type [-Werror=cast-align]
                 header *new_header = reinterpret_cast<header *>(pool);
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors

Enabling -Werror unconditionally is probably not a good idea.

@hobu
Copy link
Member

hobu commented Apr 9, 2018

Enabling -Werror unconditionally is probably not a good idea.

Probably true, but we thought we'd try it.

@sebastic
Copy link
Contributor Author

sebastic commented Apr 9, 2018

May I suggest instead to selectively promote certain warnings to errors, the ones you know you don't want in the source tree.

Every new GCC release will break the PDAL build due to new warnings it introduces.

To deal with this issue I've patched out -Werror in cmake/unix_compiler_options.cmake for the Debian package build.

@hobu
Copy link
Member

hobu commented Apr 9, 2018

May I suggest instead to selectively promote certain warnings to errors, the ones you know you don't want in the source tree.

Or we could just back out -Werror. I don't think @abellgithub likes it very much although it did find a few maybe-bugs.

@sebastic
Copy link
Contributor Author

sebastic commented Apr 9, 2018

Removing -Werror is the least that should happen. Depending on what you're trying to achieve with that, other changes should be made.

Doing log analysis on the warnings may be an option to get rid of certain classes of issues for example.

@abellgithub
Copy link
Contributor

abellgithub commented Apr 9, 2018

I think you should always build with -Werror. If you don't think the warnings are important to fix, you can suppress them by turning them off at the command-line or individually with pragmas. Most of the time you should fix them.

If we're targeting certain compilers/architectures, we should build for them before we release and hopefully test for them. Having some experience with targeting various systems/architectures, I can say that it can be problematic to say "yep, it compiles" and call it good. Of course, it may work just fine, but then again...

Maybe we're not in a position to be providing PDAL packages for architectures we have no access to. Are there VMs we can spin up?

I should add that people are welcome to build PDAL in any way they choose -- this is open source. But I'm not sure where the line gets drawn WRT our responsibility.

@sebastic
Copy link
Contributor Author

sebastic commented Apr 9, 2018

You can emulate some of the architectures with QEMU, that's about as generally accessible those get. It better than nothing, but QEMU introduces its own bugs, so not something you can rely on 100%.

-Werror caused build failures because the compiler version of your users is not included in your build matrix is a disservice to those same users.

You should only enable -Werror when your test builds cover every likely environment, but Travis won't be able to give you that.

For now I can live with having to patch out -Werror in the Debian package, but if issues like these persist I will consider PDAL unfit for inclusion in Debian and its derivatives and have the package removed.

@hobu
Copy link
Member

hobu commented Apr 9, 2018

-Werror caused build failures because the compiler version of your users is not included in your build matrix is a disservice to those same users.

Well, we're not the Debian project here, and maintaining a build matrix of Travis + AppVeyor is plenty. We've never actually run or tested PDAL on any of those environments you're showing compilation failures in, we've never compiled PDAL on those environments, and we've never advertised that PDAL even works on those environments. It's also not our project's responsibility to ensure PDAL works on platforms we don't have access to develop upon. Caveat emptor.

For now I can live with having to patch out -Werror in the Debian package, but if issues like these persist I will consider PDAL unfit for inclusion in Debian and its derivatives and have the package removed.

So you wish us to leave -Werror off, leave the warnings alone, and let the bugs in those platforms lay?

hobu added a commit that referenced this issue Apr 9, 2018
@sebastic
Copy link
Contributor Author

So you wish us to leave -Werror off, leave the warnings alone, and let the bugs in those platforms lay?

No, as I said before:

Removing -Werror is the least that should happen. Depending on what you're trying to achieve with that, other changes should be made.

Doing log analysis on the warnings may be an option to get rid of certain classes of issues for example.

Regarding other architectures, only amd64 and i386 are important everything else is nice to have. Although since PDAL built there before it should continue to do so, or it will block testing migration and hence inclusion in the next stable release.

That's the reason why I have to care about PDAL building on those architectures, although there are unlikely to be any users of PDAL on those architectures. armhf for Android and arm64 for newer ARM hardware may have or get actual users of PDAL, those are the other two (along with amd64 and i386) which you should strive to support upstream.

@landryb
Copy link
Contributor

landryb commented Apr 10, 2018

Fwiw, on OpenBSD/amd64, trying to build PDAL 1.7.1 with clang 6.0.0, -Werror is also blowing but because of a different c++ issue:

In file included from /usr/obj/ports/pdal-1.7.1/PDAL-1.7.1-src/dimbuilder/DimBuilder.cpp:34:                                              
In file included from /usr/include/c++/v1/iostream:38:
In file included from /usr/include/c++/v1/ios:216:
In file included from /usr/include/c++/v1/__locale:15:
In file included from /usr/include/c++/v1/string:442:
In file included from /usr/include/c++/v1/algorithm:634:
/usr/include/c++/v1/memory:2541:13: error: delete called on 'pdal::Arg' that is abstract but has non-virtual destructor [-Werror,-Wdelete-non-virtual-dtor]
            delete __ptr;
            ^
/usr/include/c++/v1/memory:2747:13: note: in instantiation of member function 'std::__1::default_delete<pdal::Arg>::operator()' requested here
            __ptr_.second()(__tmp);
            ^
/usr/include/c++/v1/memory:2715:46: note: in instantiation of member function 'std::__1::unique_ptr<pdal::Arg, std::__1::default_delete<pdal::Arg> >::reset' requested here
    _LIBCPP_INLINE_VISIBILITY ~unique_ptr() {reset();}
                                             ^
/usr/obj/ports/pdal-1.7.1/PDAL-1.7.1-src/pdal/util/ProgramArgs.hpp:1044:26: note: in instantiation of member function 'std::__1::unique_ptr<pdal::Arg, std::__1::default_delete<pdal::Arg> >::~unique_ptr' requested here                                                            
        m_args.push_back(std::unique_ptr<Arg>(arg));
                         ^
/usr/obj/ports/pdal-1.7.1/PDAL-1.7.1-src/pdal/util/ProgramArgs.hpp:944:16: note: in instantiation of function template specialization 'pdal::ProgramArgs::add<std::__1::basic_string<char> >' requested here
        return add<std::string>(name, description, var, def);
               ^
1 error generated.

Locally backporting fb002d5 of course helps.

@greuff
Copy link

greuff commented Apr 11, 2018

On Mac (with PDAL 1.7.1 from Homebrew), I added

set_target_properties(pdalcpp PROPERTIES
        INTERFACE_COMPILE_OPTIONS "-std=c++11;-Wextra;-Wpedantic;-Wall;-Wno-unused-parameter;-Wno-unused-variable;-Wpointer-arith;-Wcast-align;-Wcast-qual;-Wredundant-decls;-Wno-long-long;-Wno-unknown-pragmas;-Wno-deprecated-declarations")

to my project's CMakeLists.txt file, which was taken from /usr/local/Cellar/pdal/1.7.1/lib/pdal/cmake/PDALTargets.cmake and has the -Werror flag removed. Which, I agree, should not have been there in the first place.

@greuff
Copy link

greuff commented Apr 11, 2018

In fact, I'm not quite sure why PDAL exports INTERFACE_COMPILE_OPTIONS at all. These are flags that bleed over to my own project just because I'm using PDAL, which feels nasty. I would like to configure my own compiler warnings and error behaviour, because I know my project best.

From the CMake docs:

INTERFACE_COMPILE_OPTIONS: [...] Targets may populate this property to publish the compile options required to compile against the headers for the target. - https://cmake.org/cmake/help/v3.7/prop_tgt/INTERFACE_COMPILE_OPTIONS.html

-std=c++11 I do get, but everything else I do not, and are not required for compiling against the headers of PDAL. These are warnings for your own development, to spot problems that arise from your own headers. These should not bleed over to users of the library just by compiling against it.

I don't know CMake very well, but probably you should put that list of warnings into COMPILE_OPTIONS, or some other property that does not have unintended side effects for users of the library?

@abellgithub
Copy link
Contributor

The complaint about INTERFACE_COMPILE_OPTIONS is separate (I think). Opened #1922 to address this.

@abellgithub abellgithub mentioned this issue Apr 23, 2018
@abellgithub abellgithub added this to the 1.7.2 milestone May 9, 2018
@sebastic
Copy link
Contributor Author

The -Werror related failures from this issue are fixed in 1.7.1-rc1 with the changes from
fb002d5.

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

5 participants