Repository navigation
Closed
Labels
BugGlobal flag to mark a deviation from expected behaviour
Description
Describe the bug
Can't build on latest arch linux after updating my system I just couldn't build it also several other libraries too .. not sure if it's arch or assimp .. any ways tested it with the latest arch:base-devel docker image and it doesn't compile .. it give this error message :
FAILED: code/CMakeFiles/assimp.dir/AssetLib/FBX/FBXAnimation.cpp.o
/usr/bin/c++ -DASSIMP_BUILD_DLL_EXPORT -DASSIMP_BUILD_NO_C4D_IMPORTER -DASSIMP_BUILD_NO_M3D_EXPORTER -DASSIMP_BUILD_NO_M3D_IMPORTER -DASSIMP_IMPORTER_GLTF_USE_OPEN3DGC=1 -DMINIZ_USE_UNALIGNED_LOADS_AND_STORES=0 -DOPENDDLPARSER_BUILD -DRAPIDJSON_HAS_STDSTRING=1 -DRAPIDJSON_NOMEMBERITERATORCLASS -Dassimp_EXPORTS -I/home/thegeeko/repos/assimp/build/include -I/home/thegeeko/repos/assimp/build -I/home/thegeeko/repos/assimp/include -I/home/thegeeko/repos/assimp/code -I/home/thegeeko/repos/assimp/. -I/home/thegeeko/repos/assimp/contrib/zlib -I/home/thegeeko/repos/assimp/build/contrib/zlib -I/home/thegeeko/repos/assimp/code/../contrib/pugixml/src -I/home/thegeeko/repos/assimp/code/../contrib/rapidjson/include -I/home/thegeeko/repos/assimp/code/../contrib -I/home/thegeeko/repos/assimp/code/../contrib/unzip -I/home/thegeeko/repos/assimp/code/../contrib/openddlparser/include -I/home/thegeeko/repos/assimp/code/../include -I/home/thegeeko/repos/assimp/build/code/../include -I/home/thegeeko/repos/assimp/code/.. -fvisibility=hidden -fno-strict-aliasing -Wall -std=gnu++17 -fPIC -Wall -Werror -MD -MT code/CMakeFiles/assimp.dir/AssetLib/FBX/FBXAnimation.cpp.o -MF code/CMakeFiles/assimp.dir/AssetLib/FBX/FBXAnimation.cpp.o.d -o code/CMakeFiles/assimp.dir/AssetLib/FBX/FBXAnimation.cpp.o -c /home/thegeeko/repos/assimp/code/AssetLib/FBX/FBXAnimation.cpp
/home/thegeeko/repos/assimp/code/AssetLib/FBX/FBXAnimation.cpp: In constructor ‘Assimp::FBX::AnimationCurve::AnimationCurve(uint64_t, const Assimp::FBX::Element&, const std::string&, const Assimp::FBX::Document&)’:
/home/thegeeko/repos/assimp/code/AssetLib/FBX/FBXAnimation.cpp:63:20: error: possibly dangling reference to a temporary [-Werror=dangling-reference]
63 | const Element &KeyTime = GetRequiredElement(sc, "KeyTime");
| ^~~~~~~
/home/thegeeko/repos/assimp/code/AssetLib/FBX/FBXAnimation.cpp:63:48: note: the temporary was destroyed at the end of the full expression ‘Assimp::FBX::GetRequiredElement((* & sc), std::__cxx11::basic_string<char>(((const char*)"KeyTime"), std::allocator<char>()), 0)’
63 | const Element &KeyTime = GetRequiredElement(sc, "KeyTime");
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
/home/thegeeko/repos/assimp/code/AssetLib/FBX/FBXAnimation.cpp:64:20: error: possibly dangling reference to a temporary [-Werror=dangling-reference]
64 | const Element &KeyValueFloat = GetRequiredElement(sc, "KeyValueFloat");
| ^~~~~~~~~~~~~
/home/thegeeko/repos/assimp/code/AssetLib/FBX/FBXAnimation.cpp:64:54: note: the temporary was destroyed at the end of the full expression ‘Assimp::FBX::GetRequiredElement((* & sc), std::__cxx11::basic_string<char>(((const char*)"KeyValueFloat"), std::allocator<char>()), 0)’
64 | const Element &KeyValueFloat = GetRequiredElement(sc, "KeyValueFloat");
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
To Reproduce
Steps to reproduce the behavior:
- docker pull archlinux:base-devel
- docker run -i -t archlinux:base-devel /bin/bash
- git clone --depth 1 https://github.com/assimp/assimp.git
- mkdir build && cd build && cmake .. && make
Platform (please complete the following information):
- OS: Linux 6.3.8-arch1-1 SMP PREEMPT_DYNAMIC +0000 x86_64 GNU/Linux
- Version master
Metadata
Metadata
Assignees
Labels
BugGlobal flag to mark a deviation from expected behaviour
Type
Projects
- StatusShow more project fields✅ Done
Activity
thegeeko commentedon Jun 19, 2023
ok .. I've just located the issue it's gcc .. the error happens in gcc 13 this version :
thegeeko commentedon Jun 19, 2023
gcc added these new warnings in the 13 version :
-Wself-move warns when a value is moved to itself with std::move (PR81159)
-Wdangling-reference warns when a reference is bound to a temporary whose lifetime has ended (PR106393)
The -Wpessimizing-move and -Wredundant-move warnings have been extended to warn in more contexts.
The -nostdlib++ option has been added, to enable linking with g++ without implicitly linking in the C++ standard library.
I'm working on removing them from Assimp
turol commentedon Jun 19, 2023
I think this is a false positive. The reference should end up pointing into an element in the map. As long as the map is not altered the reference stays good.
thegeeko commentedon Jun 19, 2023
Ueah it is.. there's a couple of similar warnings ..
Anyway when I replaced the ref with
const ptr* constthe compiler warning gone .. they're effectively the same .. or we can tell the compiler to stop the warningskimkulling commentedon Jun 20, 2023
It would be easier to stop the warnings. I have to think about this.
kimkulling commentedon Jun 20, 2023
I checked the code and from my point of view, the best solution would be to switch off the warnings for g++ 13. The warnings are just false positives.
thegeeko commentedon Jun 21, 2023
should I go and add this to assimp's cmake ??
kimkulling commentedon Jun 28, 2023
If you have time for preparing a PR I would be really happy. Time is a rare resource right now.