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

manage "uninitialized" warnings #976

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

christian-rauch
Copy link
Collaborator

This fixes an maybe-uninitialized warning/error in struct face_t that is reported with g++ 14.

Fixes #975.

@dragonblade316
Copy link

Thanks for working on this. I am also running into this issue.

include:
- os: ubuntu-22.04
package_manager: "apt"

- os: ubuntu-24.04
package_manager: "apt"

- os: ubuntu-24.04
package_manager: "apt"
compiler: "g++-14"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Fedora g++ has been upgraded to 15.0.1 for F42+. I'm not sure if it's possible to also add that version to CI?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somehow yes. But not with the packages in the Ubuntu repos. I assume you either have to switch this pipeline to Docker images or add builds of the newer compilers to this.

Copy link
Contributor

@damaestro damaestro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two build failures:

In file included from /usr/include/eigen3/Eigen/Core:294,
                 from /pangolin-gcc15-fix/components/pango_opengl/include/pangolin/gl/opengl_render_state.h:40,
                 from /pangolin-gcc15-fix/components/pango_opengl/include/pangolin/gl/glsl.h:40,
                 from /pangolin-gcc15-fix/components/pango_python/src/pypangolin/glsl.cpp:29:
In member function 'Eigen::PlainObjectBase<Eigen::Matrix<float, 3, 3, 0, 3, 3> >::operator=(Eigen::PlainObjectBase<Eigen::Matrix<float, 3, 3, 0, 3, 3> >&&)',
    inlined from 'Eigen::Matrix<float, 3, 3, 0, 3, 3>::operator=(Eigen::Matrix<float, 3, 3, 0, 3, 3>&&)' at /usr/include/eigen3/Eigen/src/Core/Matrix.h:281:22,
    inlined from 'pybind11::detail::type_caster<Eigen::Matrix<float, 3, 3, 0, 3, 3>, void>::load(pybind11::handle, bool)' at /usr/include/pybind11/eigen/matrix.h:320:15:
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:504:7: error: 'MEM[(struct PlainObjectBase &)&D.631158].m_storage' may be used uninitialized [-Werror=maybe-uninitialized]
  504 |       m_storage = std::move(other.m_storage);
      |       ^~~~~~~~~
In file included from /usr/include/pybind11/eigen.h:12,
                 from /pangolin-gcc15-fix/components/pango_python/src/pypangolin/glsl.cpp:30:
/usr/include/pybind11/eigen/matrix.h: In member function 'pybind11::detail::type_caster<Eigen::Matrix<float, 3, 3, 0, 3, 3>, void>::load(pybind11::handle, bool)':
/usr/include/pybind11/eigen/matrix.h:320:17: note: '<anonymous>' declared here
  320 |         value = Type(fits.rows, fits.cols);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
In member function 'Eigen::PlainObjectBase<Eigen::Matrix<float, 4, 4, 0, 4, 4> >::operator=(Eigen::PlainObjectBase<Eigen::Matrix<float, 4, 4, 0, 4, 4> >&&)',
    inlined from 'Eigen::Matrix<float, 4, 4, 0, 4, 4>::operator=(Eigen::Matrix<float, 4, 4, 0, 4, 4>&&)' at /usr/include/eigen3/Eigen/src/Core/Matrix.h:281:22,
    inlined from 'pybind11::detail::type_caster<Eigen::Matrix<float, 4, 4, 0, 4, 4>, void>::load(pybind11::handle, bool)' at /usr/include/pybind11/eigen/matrix.h:320:15:
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:504:7: error: 'MEM[(struct PlainObjectBase &)&D.631260].m_storage' may be used uninitialized [-Werror=maybe-uninitialized]
  504 |       m_storage = std::move(other.m_storage);
      |       ^~~~~~~~~
/usr/include/pybind11/eigen/matrix.h: In member function 'pybind11::detail::type_caster<Eigen::Matrix<float, 4, 4, 0, 4, 4>, void>::load(pybind11::handle, bool)':
/usr/include/pybind11/eigen/matrix.h:320:17: note: '<anonymous>' declared here
  320 |         value = Type(fits.rows, fits.cols);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
In member function 'Eigen::PlainObjectBase<Eigen::Matrix<double, 3, 3, 0, 3, 3> >::operator=(Eigen::PlainObjectBase<Eigen::Matrix<double, 3, 3, 0, 3, 3> >&&)',
    inlined from 'Eigen::Matrix<double, 3, 3, 0, 3, 3>::operator=(Eigen::Matrix<double, 3, 3, 0, 3, 3>&&)' at /usr/include/eigen3/Eigen/src/Core/Matrix.h:281:22,
    inlined from 'pybind11::detail::type_caster<Eigen::Matrix<double, 3, 3, 0, 3, 3>, void>::load(pybind11::handle, bool)' at /usr/include/pybind11/eigen/matrix.h:320:15:
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:504:7: error: 'MEM[(struct PlainObjectBase &)&D.631545].m_storage' may be used uninitialized [-Werror=maybe-uninitialized]
  504 |       m_storage = std::move(other.m_storage);
      |       ^~~~~~~~~
/usr/include/pybind11/eigen/matrix.h: In member function 'pybind11::detail::type_caster<Eigen::Matrix<double, 3, 3, 0, 3, 3>, void>::load(pybind11::handle, bool)':
/usr/include/pybind11/eigen/matrix.h:320:17: note: '<anonymous>' declared here
  320 |         value = Type(fits.rows, fits.cols);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
In member function 'Eigen::PlainObjectBase<Eigen::Matrix<double, 4, 4, 0, 4, 4> >::operator=(Eigen::PlainObjectBase<Eigen::Matrix<double, 4, 4, 0, 4, 4> >&&)',
    inlined from 'Eigen::Matrix<double, 4, 4, 0, 4, 4>::operator=(Eigen::Matrix<double, 4, 4, 0, 4, 4>&&)' at /usr/include/eigen3/Eigen/src/Core/Matrix.h:281:22,
    inlined from 'pybind11::detail::type_caster<Eigen::Matrix<double, 4, 4, 0, 4, 4>, void>::load(pybind11::handle, bool)' at /usr/include/pybind11/eigen/matrix.h:320:15:
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:504:7: error: 'MEM[(struct PlainObjectBase &)&D.631646].m_storage' may be used uninitialized [-Werror=maybe-uninitialized]
  504 |       m_storage = std::move(other.m_storage);
      |       ^~~~~~~~~
/usr/include/pybind11/eigen/matrix.h: In member function 'pybind11::detail::type_caster<Eigen::Matrix<double, 4, 4, 0, 4, 4>, void>::load(pybind11::handle, bool)':
/usr/include/pybind11/eigen/matrix.h:320:17: note: '<anonymous>' declared here
  320 |         value = Type(fits.rows, fits.cols);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
At top level:
cc1plus: note: unrecognized command-line option '-Wno-null-pointer-subtraction' may have been intended to silence earlier diagnostics
cc1plus: note: unrecognized command-line option '-Wno-null-pointer-arithmetic' may have been intended to silence earlier diagnostics
In file included from /usr/include/eigen3/Eigen/Core:294,
                 from /pangolin-gcc15-fix/components/pango_opengl/include/pangolin/gl/glformattraits.h:33,
                 from /pangolin-gcc15-fix/components/pango_opengl/include/pangolin/gl/gldraw.h:31,
                 from /pangolin-gcc15-fix/components/pango_python/src/pypangolin/gl_draw.cpp:29:
In member function 'Eigen::PlainObjectBase<Eigen::Matrix<float, 3, 3, 0, 3, 3> >::operator=(Eigen::PlainObjectBase<Eigen::Matrix<float, 3, 3, 0, 3, 3> >&&)',
    inlined from 'Eigen::Matrix<float, 3, 3, 0, 3, 3>::operator=(Eigen::Matrix<float, 3, 3, 0, 3, 3>&&)' at /usr/include/eigen3/Eigen/src/Core/Matrix.h:281:22,
    inlined from 'pybind11::detail::type_caster<Eigen::Matrix<float, 3, 3, 0, 3, 3>, void>::load(pybind11::handle, bool)' at /usr/include/pybind11/eigen/matrix.h:320:15:
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:504:7: error: 'MEM[(struct PlainObjectBase &)&D.583190].m_storage' may be used uninitialized [-Werror=maybe-uninitialized]
  504 |       m_storage = std::move(other.m_storage);
      |       ^~~~~~~~~
In file included from /usr/include/pybind11/eigen.h:12,
                 from /pangolin-gcc15-fix/components/pango_python/src/pypangolin/gl_draw.cpp:30:
/usr/include/pybind11/eigen/matrix.h: In member function 'pybind11::detail::type_caster<Eigen::Matrix<float, 3, 3, 0, 3, 3>, void>::load(pybind11::handle, bool)':
/usr/include/pybind11/eigen/matrix.h:320:17: note: '<anonymous>' declared here
  320 |         value = Type(fits.rows, fits.cols);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
In member function 'Eigen::PlainObjectBase<Eigen::Matrix<double, 3, 3, 0, 3, 3> >::operator=(Eigen::PlainObjectBase<Eigen::Matrix<double, 3, 3, 0, 3, 3> >&&)',
    inlined from 'Eigen::Matrix<double, 3, 3, 0, 3, 3>::operator=(Eigen::Matrix<double, 3, 3, 0, 3, 3>&&)' at /usr/include/eigen3/Eigen/src/Core/Matrix.h:281:22,
    inlined from 'pybind11::detail::type_caster<Eigen::Matrix<double, 3, 3, 0, 3, 3>, void>::load(pybind11::handle, bool)' at /usr/include/pybind11/eigen/matrix.h:320:15:
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:504:7: error: 'MEM[(struct PlainObjectBase &)&D.583520].m_storage' may be used uninitialized [-Werror=maybe-uninitialized]
  504 |       m_storage = std::move(other.m_storage);
      |       ^~~~~~~~~
/usr/include/pybind11/eigen/matrix.h: In member function 'pybind11::detail::type_caster<Eigen::Matrix<double, 3, 3, 0, 3, 3>, void>::load(pybind11::handle, bool)':
/usr/include/pybind11/eigen/matrix.h:320:17: note: '<anonymous>' declared here
  320 |         value = Type(fits.rows, fits.cols);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
In member function 'Eigen::PlainObjectBase<Eigen::Matrix<float, 4, 4, 0, 4, 4> >::operator=(Eigen::PlainObjectBase<Eigen::Matrix<float, 4, 4, 0, 4, 4> >&&)',
    inlined from 'Eigen::Matrix<float, 4, 4, 0, 4, 4>::operator=(Eigen::Matrix<float, 4, 4, 0, 4, 4>&&)' at /usr/include/eigen3/Eigen/src/Core/Matrix.h:281:22,
    inlined from 'pybind11::detail::type_caster<Eigen::Matrix<float, 4, 4, 0, 4, 4>, void>::load(pybind11::handle, bool)' at /usr/include/pybind11/eigen/matrix.h:320:15:
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:504:7: error: 'MEM[(struct PlainObjectBase &)&D.583649].m_storage' may be used uninitialized [-Werror=maybe-uninitialized]
  504 |       m_storage = std::move(other.m_storage);
      |       ^~~~~~~~~
/usr/include/pybind11/eigen/matrix.h: In member function 'pybind11::detail::type_caster<Eigen::Matrix<float, 4, 4, 0, 4, 4>, void>::load(pybind11::handle, bool)':
/usr/include/pybind11/eigen/matrix.h:320:17: note: '<anonymous>' declared here
  320 |         value = Type(fits.rows, fits.cols);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
In member function 'Eigen::PlainObjectBase<Eigen::Matrix<double, 4, 4, 0, 4, 4> >::operator=(Eigen::PlainObjectBase<Eigen::Matrix<double, 4, 4, 0, 4, 4> >&&)',
    inlined from 'Eigen::Matrix<double, 4, 4, 0, 4, 4>::operator=(Eigen::Matrix<double, 4, 4, 0, 4, 4>&&)' at /usr/include/eigen3/Eigen/src/Core/Matrix.h:281:22,
    inlined from 'pybind11::detail::type_caster<Eigen::Matrix<double, 4, 4, 0, 4, 4>, void>::load(pybind11::handle, bool)' at /usr/include/pybind11/eigen/matrix.h:320:15:
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:504:7: error: 'MEM[(struct PlainObjectBase &)&D.583786].m_storage' may be used uninitialized [-Werror=maybe-uninitialized]
  504 |       m_storage = std::move(other.m_storage);
      |       ^~~~~~~~~
/usr/include/pybind11/eigen/matrix.h: In member function 'pybind11::detail::type_caster<Eigen::Matrix<double, 4, 4, 0, 4, 4>, void>::load(pybind11::handle, bool)':
/usr/include/pybind11/eigen/matrix.h:320:17: note: '<anonymous>' declared here
  320 |         value = Type(fits.rows, fits.cols);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
In member function 'Eigen::PlainObjectBase<Eigen::Matrix<double, 3, 1, 0, 3, 1> >::operator=(Eigen::PlainObjectBase<Eigen::Matrix<double, 3, 1, 0, 3, 1> >&&)',
    inlined from 'Eigen::Matrix<double, 3, 1, 0, 3, 1>::operator=(Eigen::Matrix<double, 3, 1, 0, 3, 1>&&)' at /usr/include/eigen3/Eigen/src/Core/Matrix.h:281:22,
    inlined from 'pybind11::detail::type_caster<Eigen::Matrix<double, 3, 1, 0, 3, 1>, void>::load(pybind11::handle, bool)' at /usr/include/pybind11/eigen/matrix.h:320:15:
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:504:7: error: 'MEM[(struct PlainObjectBase &)&D.585585].m_storage' may be used uninitialized [-Werror=maybe-uninitialized]
  504 |       m_storage = std::move(other.m_storage);
      |       ^~~~~~~~~
/usr/include/pybind11/eigen/matrix.h: In member function 'pybind11::detail::type_caster<Eigen::Matrix<double, 3, 1, 0, 3, 1>, void>::load(pybind11::handle, bool)':
/usr/include/pybind11/eigen/matrix.h:320:17: note: '<anonymous>' declared here
  320 |         value = Type(fits.rows, fits.cols);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
In member function 'Eigen::PlainObjectBase<Eigen::Matrix<float, 3, 1, 0, 3, 1> >::operator=(Eigen::PlainObjectBase<Eigen::Matrix<float, 3, 1, 0, 3, 1> >&&)',
    inlined from 'Eigen::Matrix<float, 3, 1, 0, 3, 1>::operator=(Eigen::Matrix<float, 3, 1, 0, 3, 1>&&)' at /usr/include/eigen3/Eigen/src/Core/Matrix.h:281:22,
    inlined from 'pybind11::detail::type_caster<Eigen::Matrix<float, 3, 1, 0, 3, 1>, void>::load(pybind11::handle, bool)' at /usr/include/pybind11/eigen/matrix.h:320:15:
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:504:7: error: 'MEM[(struct PlainObjectBase &)&D.587243].m_storage' may be used uninitialized [-Werror=maybe-uninitialized]
  504 |       m_storage = std::move(other.m_storage);
      |       ^~~~~~~~~
/usr/include/pybind11/eigen/matrix.h: In member function 'pybind11::detail::type_caster<Eigen::Matrix<float, 3, 1, 0, 3, 1>, void>::load(pybind11::handle, bool)':
/usr/include/pybind11/eigen/matrix.h:320:17: note: '<anonymous>' declared here
  320 |         value = Type(fits.rows, fits.cols);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~

@damaestro
Copy link
Contributor

Reproducer:

FROM registry.fedoraproject.org/fedora:rawhide

# BuildRequires
RUN dnf install -y \
    @buildsys-build \
    cmake \
    doxygen \
    gcc-c++ \
    git \
    msimonson-anonymouspro-fonts \
    ninja-build \
    "pkgconfig(catch2)" \
    "pkgconfig(eigen3)" \
    "pkgconfig(epoxy)" \
    "pkgconfig(glew)" \
    "pkgconfig(opengl)" \
    "pkgconfig(pybind11)" \
    python3-devel \
    python3-setuptools \
    python3-wheel \
    rapidxml-devel

# Source0
RUN git clone https://github.com/christian-rauch/Pangolin.git pangolin-gcc15-fix

WORKDIR pangolin-gcc15-fix

RUN git checkout ci_compiler

# Unbundle and use system libs
RUN rm -rf components/pango_python/pybind11 \
    && rm -rf components/pango_core/include/pangolin/utils/xml

# Build
ENV RPM_BUILD_NCPUS=4
ENV RPM_ARCH=x86_64
ENV RPM_PACKAGE_RELEASE=1
ENV RPM_PACKAGE_VERSION=0.9.3
ENV RPM_PACKAGE_NAME=pangolin
ENV CFLAGS="${CFLAGS:--O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer }" 
ENV CXXFLAGS="${CXXFLAGS:--O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer }" 
ENV FFLAGS="${FFLAGS:--O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules }" 
ENV FCFLAGS="${FCFLAGS:--O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules }"
ENV VALAFLAGS="${VALAFLAGS:--g}"
ENV RUSTFLAGS="${RUSTFLAGS:--Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cstrip=none -Cforce-frame-pointers=yes -Clink-arg=-specs=/usr/lib/rpm/redhat/redhat-package-notes --cap-lints=warn}" 
ENV LDFLAGS="${LDFLAGS:--Wl,-z,relro -Wl,--as-needed  -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes }" 
ENV LT_SYS_LIBRARY_PATH="${LT_SYS_LIBRARY_PATH:-/usr/lib64:}"
ENV CC="${CC:-gcc}"
ENV CXX="${CXX:-g++}"
RUN /usr/bin/cmake \
    -S "." \
    -B "redhat-linux-build" \
    -DCMAKE_C_FLAGS_RELEASE:STRING="-DNDEBUG" \
    -DCMAKE_CXX_FLAGS_RELEASE:STRING="-DNDEBUG" \
    -DCMAKE_Fortran_FLAGS_RELEASE:STRING="-DNDEBUG" \
    -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
    -DCMAKE_INSTALL_DO_STRIP:BOOL=OFF \
    -DCMAKE_INSTALL_PREFIX:PATH=/usr \
    -DCMAKE_INSTALL_FULL_SBINDIR:PATH=/usr/bin \
    -DCMAKE_INSTALL_SBINDIR:PATH=bin \
    -DINCLUDE_INSTALL_DIR:PATH=/usr/include \
    -DLIB_INSTALL_DIR:PATH=/usr/lib64 \
    -DSYSCONF_INSTALL_DIR:PATH=/etc \
    -DSHARE_INSTALL_PREFIX:PATH=/usr/share \
    -DLIB_SUFFIX=64 \
    -DBUILD_SHARED_LIBS:BOOL=ON -GNinja \
    -DCMAKE_BUILD_TYPE=RelWithDebInfo \
    -DBUILD_TESTS=ON \
    -DBUILD_SHARED_LIBS=ON \
    -DBUILD_TOOLS=OFF \
    -DBUILD_EXAMPLES=OFF
RUN cmake --build "redhat-linux-build" -j${RPM_BUILD_NCPUS} --verbose

@christian-rauch
Copy link
Collaborator Author

Two build failures:

In file included from /usr/include/eigen3/Eigen/Core:294,
                 from /pangolin-gcc15-fix/components/pango_opengl/include/pangolin/gl/opengl_render_state.h:40,
                 from /pangolin-gcc15-fix/components/pango_opengl/include/pangolin/gl/glsl.h:40,
                 from /pangolin-gcc15-fix/components/pango_python/src/pypangolin/glsl.cpp:29:
In member function 'Eigen::PlainObjectBase<Eigen::Matrix<float, 3, 3, 0, 3, 3> >::operator=(Eigen::PlainObjectBase<Eigen::Matrix<float, 3, 3, 0, 3, 3> >&&)',
    inlined from 'Eigen::Matrix<float, 3, 3, 0, 3, 3>::operator=(Eigen::Matrix<float, 3, 3, 0, 3, 3>&&)' at /usr/include/eigen3/Eigen/src/Core/Matrix.h:281:22,
    inlined from 'pybind11::detail::type_caster<Eigen::Matrix<float, 3, 3, 0, 3, 3>, void>::load(pybind11::handle, bool)' at /usr/include/pybind11/eigen/matrix.h:320:15:
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:504:7: error: 'MEM[(struct PlainObjectBase &)&D.631158].m_storage' may be used uninitialized [-Werror=maybe-uninitialized]
  504 |       m_storage = std::move(other.m_storage);
      |       ^~~~~~~~~
[...]

This looks like the Eigen::Matrix<> error messages I mentioned in #975 (comment). This is supposed to be ignored with

if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
# ignore "maybe-uninitialized" for Eigen
target_compile_options(${COMPONENT} PRIVATE "-Wno-uninitialized")
endif()
. I don't know why this does not work for you.

@christian-rauch
Copy link
Collaborator Author

@damaestro I think the maybe-uninitialized compiler flags did the trick. Can you test?

@christian-rauch christian-rauch changed the title test with g++ 14 and fix manage "uninitialized" warnings Mar 9, 2025
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

Successfully merging this pull request may close these issues.

tinyobj.cpp Build Failure in v0.9.3
4 participants