master fails to compile
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Thu May 22 14:08:36 CEST 2025
Hi Milan,
On Thu, May 22, 2025 at 11:07:37AM +0200, Milan Zamazal wrote:
> Hi,
>
> libcamera fails to compile for me today with gcc 15.1.1:
We don't have gcc 15 in CI :-/ I wonder if it can be easily installed in
Debian Trixie.
> FAILED: src/libcamera/libcamera.so.0.5.0.p/matrix.cpp.o
> g++ -Isrc/libcamera/libcamera.so.0.5.0.p -Isrc/libcamera -I../src/libcamera -Iinclude -I../include -Isubprojects/libpisp/src -I../subprojects/libpisp/src -Isubprojects/libpisp/src/libpisp -I../subprojects/libpisp/src/libpisp -Iinclude/libcamera -Iinclude/libcamera/ipa -Iinclude/libcamera/internal -Isrc/libcamera/proxy -I/usr/include/p11-kit-1 -fdiagnostics-color=always -D_GLIBCXX_ASSERTIONS=1 -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -std=c++17 -O2 -g -Wnon-virtual-dtor -Wno-redundant-move -Wmissing-declarations -Wshadow -include /home/pdm/git/git.libcamera.org/libcamera/libcamera/build/config.h -fPIC -DLIBCAMERA_BASE_PRIVATE -MD -MQ src/libcamera/libcamera.so.0.5.0.p/matrix.cpp.o -MF src/libcamera/libcamera.so.0.5.0.p/matrix.cpp.o.d -o src/libcamera/libcamera.so.0.5.0.p/matrix.cpp.o -c ../src/libcamera/matrix.cpp
> In member function ‘void libcamera::matrixInvert(Span<const T>, Span<T, 18446744073709551615>, unsigned int, Span<T, 18446744073709551615>, Span<unsigned int>)::MatrixAccessor::swap(unsigned int, unsigned int) [with T = float]’,
> inlined from ‘bool libcamera::matrixInvert(Span<const T>, Span<T, 18446744073709551615>, unsigned int, Span<T, 18446744073709551615>, Span<unsigned int>) [with T = float]’ at ../src/libcamera/matrix.cpp:255:14:
> ../src/libcamera/matrix.cpp:194:34: error: ‘row’ may be used uninitialized [-Werror=maybe-uninitialized]
> 194 | std::swap(swap_[a], swap_[b]);
> | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
> ../src/libcamera/matrix.cpp: In function ‘bool libcamera::matrixInvert(Span<const T>, Span<T, 18446744073709551615>, unsigned int, Span<T, 18446744073709551615>, Span<unsigned int>) [with T = float]’:
> ../src/libcamera/matrix.cpp:232:30: note: ‘row’ was declared here
> 232 | unsigned int row;
> | ^~~
> In member function ‘void libcamera::matrixInvert(Span<const T>, Span<T, 18446744073709551615>, unsigned int, Span<T, 18446744073709551615>, Span<unsigned int>)::MatrixAccessor::swap(unsigned int, unsigned int) [with T = double]’,
> inlined from ‘bool libcamera::matrixInvert(Span<const T>, Span<T, 18446744073709551615>, unsigned int, Span<T, 18446744073709551615>, Span<unsigned int>) [with T = double]’ at ../src/libcamera/matrix.cpp:255:14:
> ../src/libcamera/matrix.cpp:194:34: error: ‘row’ may be used uninitialized [-Werror=maybe-uninitialized]
> 194 | std::swap(swap_[a], swap_[b]);
> | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
> ../src/libcamera/matrix.cpp: In function ‘bool libcamera::matrixInvert(Span<const T>, Span<T, 18446744073709551615>, unsigned int, Span<T, 18446744073709551615>, Span<unsigned int>) [with T = double]’:
> ../src/libcamera/matrix.cpp:232:30: note: ‘row’ was declared here
> 232 | unsigned int row;
> | ^~~
> cc1plus: all warnings being treated as errors
Quite interestingly, I can't reproduce the issue with gcc 15.1.0, but I
can with my gcc 13.2.0 arm64 cross-compiler.
The issue seems to be a false positive, but I'll send a patch.
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list