Skip to content

Bug: Can't build on latest arch linux #5145

Closed

Description

@thegeeko

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:

  1. docker pull archlinux:base-devel
  2. docker run -i -t archlinux:base-devel /bin/bash
  3. git clone --depth 1 https://github.com/assimp/assimp.git
  4. 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

Activity

  1. added
    Bug
    on Jun 19, 2023
  2. thegeeko commented on Jun 19, 2023

    @thegeeko
    ContributorAuthor

    ok .. I've just located the issue it's gcc .. the error happens in gcc 13 this version :

    Using built-in specs.
    COLLECT_GCC=gcc
    COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/13.1.1/lto-wrapper
    Target: x86_64-pc-linux-gnu
    Configured with: /build/gcc/src/gcc/configure --enable-languages=ada,c,c++,d,fortran,go,lto,objc,obj-c++ --enable-bootstrap --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --with-build-config=bootstrap-lto --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-libstdcxx-backtrace --enable-link-serialization=1 --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-werror
    Thread model: posix
    Supported LTO compression algorithms: zlib zstd
    gcc version 13.1.1 20230429 (GCC)
    
  3. thegeeko commented on Jun 19, 2023

    @thegeeko
    ContributorAuthor

    gcc added these new warnings in the 13 version :

    I'm working on removing them from Assimp

  4. turol commented on Jun 19, 2023

    @turol
    Member

    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.

  5. thegeeko commented on Jun 19, 2023

    @thegeeko
    ContributorAuthor

    Ueah it is.. there's a couple of similar warnings ..
    Anyway when I replaced the ref with const ptr* const the compiler warning gone .. they're effectively the same .. or we can tell the compiler to stop the warnings

  6. kimkulling commented on Jun 20, 2023

    @kimkulling
    Member

    It would be easier to stop the warnings. I have to think about this.

  7. kimkulling commented on Jun 20, 2023

    @kimkulling
    Member

    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.

  8. thegeeko commented on Jun 21, 2023

    @thegeeko
    ContributorAuthor

    should I go and add this to assimp's cmake ??

  9. kimkulling commented on Jun 28, 2023

    @kimkulling
    Member

    If you have time for preparing a PR I would be really happy. Time is a rare resource right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions