Summary: | media-libs/assimp-5.2.3 - cc1plus: all warnings being treated as errors | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Toralf Förster <toralf> |
Component: | Current packages | Assignee: | Bernd <waebbl-gentoo> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | esigra, proxy-maint |
Priority: | Normal | Keywords: | PullRequest |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: |
https://github.com/assimp/assimp/issues/4433 https://github.com/gentoo/gentoo/pull/25234 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 260867, 839906 | ||
Attachments: |
emerge-info.txt
emerge-history.txt environment etc.portage.tar.bz2 logs.tar.bz2 media-libs:assimp-5.2.3:20220424-144715.log.bz2 temp.tar.bz2 |
Description
Toralf Förster
![]() Created attachment 774121 [details]
emerge-info.txt
Created attachment 774124 [details]
emerge-history.txt
Created attachment 774127 [details]
environment
Created attachment 774130 [details]
etc.portage.tar.bz2
Created attachment 774133 [details]
logs.tar.bz2
Created attachment 774136 [details]
media-libs:assimp-5.2.3:20220424-144715.log.bz2
Created attachment 774139 [details]
temp.tar.bz2
Does gcc-12 treat all warnings as errors by default, i.e. without using the -Werror flag? (In reply to Bernd from comment #8) > Does gcc-12 treat all warnings as errors by default, i.e. without using the > -Werror flag? No, but new compiler versions often either enable new _specific_ warnings-as-errors (like -Werror=foo, but not -Werror), or improve analysis so something which was previously not detected is now found. In this case: /usr/lib/gcc/x86_64-pc-linux-gnu/12.0.1/include/g++-v12/bits/vector.tcc:114:27: error: array subscript 4294967295 is outside array bounds of ‘void [103079215088]’ [-Werror=array-bounds] 114 | if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage) | ~~~~~~~~~~~~~~^~~~~~~~~ (In reply to Sam James from comment #9) > (In reply to Bernd from comment #8) > > Does gcc-12 treat all warnings as errors by default, i.e. without using the > > -Werror flag? > > No, but new compiler versions often either enable new _specific_ > warnings-as-errors (like -Werror=foo, but not -Werror), or improve analysis > so something which was previously not detected is now found. > > In this case: sorry, I meant: FAILED: code/CMakeFiles/assimp.dir/AssetLib/SMD/SMDLoader.cpp.o /usr/bin/x86_64-pc-linux-gnu-g++ -DASSIMP_BUILD_DLL_EXPORT -DASSIMP_BUILD_NO_C4D_IMPORTER -DASSIMP_BUILD_NO_M3D_EXPORTER -DASSIMP_BUILD_NO_M3D_IMPORTER -DASSIMP_BUILD_NO_OWN_ZLIB -DASSIMP_IMPORTER_GLTF_USE_OPEN3DGC=1 -DMINIZ_USE_UNALIGNED_LOADS_AND_STORES=0 -DOPENDDLPARSER_BUILD -DRAPIDJSON_HAS_STDSTRING=1 -DRAPIDJSON_NOMEMBERITERATORCLASS -Dassimp_EXPORTS -I/var/tmp/portage/media-libs/assimp-5.2.3/work/assimp-5.2.3_build/include -I/var/tmp/portage/media-libs/assimp-5.2.3/work/assimp-5.2.3_build -I/var/tmp/portage/media-libs/assimp-5.2.3/work/assimp-5.2.3/include -I/var/tmp/portage/media-libs/assimp-5.2.3/work/assimp-5.2.3/code -I/var/tmp/portage/media-libs/assimp-5.2.3/work/assimp-5.2.3/. -I/var/tmp/portage/media-libs/assimp-5.2.3/work/assimp-5.2.3/code/../contrib/pugixml/src -I/var/tmp/portage/media-libs/assimp-5.2.3/work/assimp-5.2.3/code/../contrib/rapidjson/include -I/var/tmp/portage/media-libs/assimp-5.2.3/work/assimp-5.2.3/code/../contrib -I/var/tmp/portage/media-libs/assimp-5.2.3/work/assimp-5.2.3/code/../contrib/openddlparser/include -I/var/tmp/portage/media-libs/assimp-5.2.3/work/assimp-5.2.3/code/../include -I/var/tmp/portage/media-libs/assimp-5.2.3/work/assimp-5.2.3_build/code/../include -I/usr/include/minizip -fvisibility=hidden -fno-strict-aliasing -Wall -pipe -march=native -fno-diagnostics-color -O2 -Wall -fPIC -Werror -std=gnu++11 -MD -MT code/CMakeFiles/assimp.dir/AssetLib/SMD/SMDLoader.cpp.o -MF code/CMakeFiles/assimp.dir/AssetLib/SMD/SMDLoader.cpp.o.d -o code/CMakeFiles/assimp.dir/AssetLib/SMD/SMDLoader.cpp.o -c /var/tmp/portage/media-libs/assimp-5.2.3/work/assimp-5.2.3/code/AssetLib/SMD/SMDLoader.cpp In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/12.0.1/include/g++-v12/vector:70, from /var/tmp/portage/media-libs/assimp-5.2.3/work/assimp-5.2.3/include/assimp/DefaultLogger.hpp:57, from /var/tmp/portage/media-libs/assimp-5.2.3/work/assimp-5.2.3/include/assimp/fast_atof.h:30, from /var/tmp/portage/media-libs/assimp-5.2.3/work/assimp-5.2.3/code/AssetLib/SMD/SMDLoader.cpp:49: In member function ‘void std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {unsigned int}; _Tp = unsigned int; _Alloc = std::allocator<unsigned int>]’, inlined from ‘void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = unsigned int; _Alloc = std::allocator<unsigned int>]’ at /usr/lib/gcc/x86_64-pc-linux-gnu/12.0.1/include/g++-v12/bits/stl_vector.h:1294:21, inlined from ‘void Assimp::SMDImporter::CreateOutputMeshes()’ at /var/tmp/portage/media-libs/assimp-5.2.3/work/assimp-5.2.3/code/AssetLib/SMD/SMDLoader.cpp:255:50: /usr/lib/gcc/x86_64-pc-linux-gnu/12.0.1/include/g++-v12/bits/vector.tcc:114:27: error: array subscript 4294967295 is outside array bounds of ‘void [103079215088]’ [-Werror=array-bounds] 114 | if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage) | ~~~~~~~~~~~~~~^~~~~~~~~ /var/tmp/portage/media-libs/assimp-5.2.3/work/assimp-5.2.3/code/AssetLib/SMD/SMDLoader.cpp: In member function ‘void Assimp::SMDImporter::CreateOutputMeshes()’: /var/tmp/portage/media-libs/assimp-5.2.3/work/assimp-5.2.3/code/AssetLib/SMD/SMDLoader.cpp:240:57: note: at offset 103079215088 into object of size [8, 103079215088] allocated by ‘operator new []’ 240 | FaceList* aaiFaces = new FaceList[pScene->mNumMeshes]; | ^ In member function ‘void std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {unsigned int}; _Tp = unsigned int; _Alloc = std::allocator<unsigned int>]’, inlined from ‘void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = unsigned int; _Alloc = std::allocator<unsigned int>]’ at /usr/lib/gcc/x86_64-pc-linux-gnu/12.0.1/include/g++-v12/bits/stl_vector.h:1294:21, inlined from ‘void Assimp::SMDImporter::CreateOutputMeshes()’ at /var/tmp/portage/media-libs/assimp-5.2.3/work/assimp-5.2.3/code/AssetLib/SMD/SMDLoader.cpp:255:50: /usr/lib/gcc/x86_64-pc-linux-gnu/12.0.1/include/g++-v12/bits/vector.tcc:114:54: error: array subscript 4294967295 is outside array bounds of ‘void [103079215088]’ [-Werror=array-bounds] 114 | if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /var/tmp/portage/media-libs/assimp-5.2.3/work/assimp-5.2.3/code/AssetLib/SMD/SMDLoader.cpp: In member function ‘void Assimp::SMDImporter::CreateOutputMeshes()’: /var/tmp/portage/media-libs/assimp-5.2.3/work/assimp-5.2.3/code/AssetLib/SMD/SMDLoader.cpp:240:57: note: at offset 103079215088 into object of size [8, 103079215088] allocated by ‘operator new []’ 240 | FaceList* aaiFaces = new FaceList[pScene->mNumMeshes]; | ^ Could it be, this specific error (-Werror=array-bounds) is being added by the -Wall option? Neither the porting guide[1] nor the ChangeLog[2] has any hints on changes related to array bounds. [1] https://gcc.gnu.org/gcc-12/porting_to.html [2] https://gcc.gnu.org/gcc-12/changes.html Just noticed, the -Werror option is added as well, although it shouldn't. It works a lot better when I remove -Werror --- a/code/CMakeLists.txt 2022-03-17 06:35:44.000000000 -0400 +++ b/code/CMakeLists.txt 2022-04-27 22:10:03.270946358 -0400 @@ -1176,13 +1176,6 @@ TARGET_USE_COMMON_OUTPUT_DIRECTORY(assimp) -# enable warnings as errors ######################################## -IF (MSVC) - TARGET_COMPILE_OPTIONS(assimp PRIVATE /WX) -ELSE() - TARGET_COMPILE_OPTIONS(assimp PRIVATE -Werror) -ENDIF() - # adds C_FLAGS required to compile zip.c on old GCC 4.x compiler TARGET_COMPILE_FEATURES(assimp PRIVATE c_std_99) (In reply to Bernd from comment #11) > Could it be, this specific error (-Werror=array-bounds) is being added by > the -Wall option? Neither the porting guide[1] nor the ChangeLog[2] has any > hints on changes related to array bounds. > > [1] https://gcc.gnu.org/gcc-12/porting_to.html > [2] https://gcc.gnu.org/gcc-12/changes.html It's likely that the analyser got stricter rather than it being a new default -Werror here, I think. (In reply to cyrillic from comment #13) > It works a lot better when I remove -Werror > > --- a/code/CMakeLists.txt 2022-03-17 06:35:44.000000000 -0400 > +++ b/code/CMakeLists.txt 2022-04-27 22:10:03.270946358 -0400 > @@ -1176,13 +1176,6 @@ > > TARGET_USE_COMMON_OUTPUT_DIRECTORY(assimp) > > -# enable warnings as errors ######################################## > -IF (MSVC) > - TARGET_COMPILE_OPTIONS(assimp PRIVATE /WX) > -ELSE() > - TARGET_COMPILE_OPTIONS(assimp PRIVATE -Werror) > -ENDIF() > - > # adds C_FLAGS required to compile zip.c on old GCC 4.x compiler > TARGET_COMPILE_FEATURES(assimp PRIVATE c_std_99) In the PR I'm preparing, the ELSE() clause will be patched out as well. A global filter-flags didn't work though. (In reply to Sam James from comment #14) > (In reply to Bernd from comment #11) > > Could it be, this specific error (-Werror=array-bounds) is being added by > > the -Wall option? Neither the porting guide[1] nor the ChangeLog[2] has any > > hints on changes related to array bounds. > > > > [1] https://gcc.gnu.org/gcc-12/porting_to.html > > [2] https://gcc.gnu.org/gcc-12/changes.html > > It's likely that the analyser got stricter rather than it being a new > default -Werror here, I think. I agree, but upstream uses a global -Werror. As discussed in the linked upstream report, there's a suggestion to remove this for downstream packaging. Let's see if they pick up this suggestion. The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3c7abed13a49d96d90fdeda81bba828271cace87 commit 3c7abed13a49d96d90fdeda81bba828271cace87 Author: Bernd Waibel <waebbl-gentoo@posteo.net> AuthorDate: 2022-04-28 06:06:12 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-04-29 02:22:31 +0000 media-libs/assimp: build with gcc-12 Fix an -Werror=array-bounds issue with gcc-12, by patching out the global -Werror flag used by upstream. Drop failing tests for x86_32. Closes: https://bugs.gentoo.org/840616 Closes: https://bugs.gentoo.org/840767 Bug: https://github.com/assimp/assimp/issues/4438 Bug: https://github.com/assimp/assimp/issues/4433 Signed-off-by: Bernd Waibel <waebbl-gentoo@posteo.net> Closes: https://github.com/gentoo/gentoo/pull/25234 Signed-off-by: Sam James <sam@gentoo.org> media-libs/assimp/assimp-5.2.3.ebuild | 9 ++ .../assimp-5.2.3-drop-Werror-gcc-option.patch | 22 ++++ ...p-5.2.3-drop-failing-tests-for-abi_x86_32.patch | 131 +++++++++++++++++++++ 3 files changed, 162 insertions(+) |