You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to build with the following *FLAGS to optimize the build: -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing
The -Werror=* flags are important to detect cases where the compiler can try to optimize based on assuming UB cannot happen, and miscompile code that has UB in it. strict-aliasing issues are always bad but LTO can make them even worse.
I got this error:
FAILED: nanovdb/nanovdb/unittest/CMakeFiles/nanovdb_test_nanovdb.dir/TestNanoVDB.cc.o
/usr/bin/ccache /usr/bin/x86_64-pc-linux-gnu-g++ -DBOOST_IOSTREAMS_DYN_LINK -DBOOST_IOSTREAMS_NO_LIB -DGTEST_LINKED_AS_SHARED_LIBRARY=1 -DNANOVDB_USE_BLOSC -DNANOVDB_USE_INTRINSICS -DNANOVDB_USE_OPENVDB -DNANOVDB_USE_TBB -DNANOVDB_USE_ZIP -DOPENVDB_DLL -DOPENVDB_USE_AVX -DOPENVDB_USE_DELAYED_LOADING -DOPENVDB_USE_LOG4CPLUS -DOPENVDB_USE_SSE42 -I/var/tmp/portage/media-gfx/openvdb-11.0.0/work/openvdb-11.0.0/nanovdb/nanovdb/.. -I/var/tmp/portage/media-gfx/openvdb-11.0.0/work/openvdb-11.0.0/openvdb/openvdb/.. -I/var/tmp/portage/media-gfx/openvdb-11.0.0/work/openvdb-11.0.0_build-install/openvdb/openvdb -I/var/tmp/portage/media-gfx/openvdb-11.0.0/work/openvdb-11.0.0_build-install/openvdb/openvdb/openvdb -isystem /usr/include/Imath -march=native -fstack-protector-all -O2 -pipe -fdiagnostics-color=always -frecord-gcc-switches -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wformat -Werror=format-security -std=c++17 -fdiagnostics-color=always -mavx -msse4.2 -Wno-invalid-offsetof -MD -MT nanovdb/nanovdb/unittest/CMakeFiles/nanovdb_test_nanovdb.dir/TestNanoVDB.cc.o -MF nanovdb/nanovdb/unittest/CMakeFiles/nanovdb_test_nanovdb.dir/TestNanoVDB.cc.o.d -o nanovdb/nanovdb/unittest/CMakeFiles/nanovdb_test_nanovdb.dir/TestNanoVDB.cc.o -c /var/tmp/portage/media-gfx/openvdb-11.0.0/work/openvdb-11.0.0/nanovdb/nanovdb/unittest/TestNanoVDB.cc
In file included from /var/tmp/portage/media-gfx/openvdb-11.0.0/work/openvdb-11.0.0/nanovdb/nanovdb/unittest/TestNanoVDB.cc:40:
/var/tmp/portage/media-gfx/openvdb-11.0.0/work/openvdb-11.0.0/nanovdb/nanovdb/../nanovdb/PNanoVDB.h: In function ‘pnanovdb_uint32_t pnanovdb_float_as_uint32(float)’:
/var/tmp/portage/media-gfx/openvdb-11.0.0/work/openvdb-11.0.0/nanovdb/nanovdb/../nanovdb/PNanoVDB.h:347:86: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
347 | PNANOVDB_FORCE_INLINE pnanovdb_uint32_t pnanovdb_float_as_uint32(float v) { return *((pnanovdb_uint32_t*)(&v)); }
| ~^~~~~~~~~~~~~~~~~~~~~~~~~
/var/tmp/portage/media-gfx/openvdb-11.0.0/work/openvdb-11.0.0/nanovdb/nanovdb/../nanovdb/PNanoVDB.h: In function ‘pnanovdb_uint64_t pnanovdb_double_as_uint64(double)’:
/var/tmp/portage/media-gfx/openvdb-11.0.0/work/openvdb-11.0.0/nanovdb/nanovdb/../nanovdb/PNanoVDB.h:349:88: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
349 | PNANOVDB_FORCE_INLINE pnanovdb_uint64_t pnanovdb_double_as_uint64(double v) { return *((pnanovdb_uint64_t*)(&v)); }
| ~^~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: some warnings being treated as errors
ninja: build stopped: subcommand failed.
I tried to build with the following *FLAGS to optimize the build:
-flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing
The -Werror=* flags are important to detect cases where the compiler can try to optimize based on assuming UB cannot happen, and miscompile code that has UB in it. strict-aliasing issues are always bad but LTO can make them even worse.
I got this error:
Downstream report: https://bugs.gentoo.org/926820
Full build log: build.log
It should be noted that this error only occurs when building the testsuite.
The text was updated successfully, but these errors were encountered: