You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue was hit when unrelated changes somehow changed layout of some struct causing the optimized build -O3 -Wall -Werror to fail with error: /opt/compiler-explorer/libs/abseil/absl/container/internal/inlined_vector.h:522:5: error: 'test_obj1.absl::InlinedVector<unsigned int, 4, std::allocator<unsigned int> >::storage_.absl::inlined_vector_internal::Storage<unsigned int, 4, std::allocator<unsigned int> >::data_' is used uninitialized [-Werror=uninitialized]
Steps to reproduce the problem
It's not easy to reproduce but somehow in google test framework you can hit it rather easy:
Not all gcc versions will report it but 12 and 13 do and you will need optimization.
What version of Abseil are you using?
Seen in all 20220623 and 20240722. (and version that godbolt uses)
What operating system and version are you using?
Should not really mater here:
$ uname -a
Linux 5007575312c8 5.15.0-102-generic #112-Ubuntu SMP Tue Mar 5 16:50:32 UTC 2024 x86_64 GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 12 (bookworm)
Release: 12
Codename: bookworm
What compiler and version are you using?
$ /usr/bin/x86_64-linux-gnu-g++-12 --version
x86_64-linux-gnu-g++-12 (Debian 12.2.0-14) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
What build system are you using?
$ cmake --version
cmake version 3.25.1
Additional context
It's unclear if this is a compiler bug or technical correct as the MemcpyFrom function literately copies the uninitialized data_ union.
FWIW, this looks like basically a duplicate of https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95825 (same issue in boost::optional). That issue talks about copy-constructing rather than copy-assigning, but it feels like the same underlying issue. The best answer for now might be "just turn off that noisy GCC warning."
Describe the issue
Issue was hit when unrelated changes somehow changed layout of some struct causing the optimized build -O3 -Wall -Werror to fail with error:
/opt/compiler-explorer/libs/abseil/absl/container/internal/inlined_vector.h:522:5: error: 'test_obj1.absl::InlinedVector<unsigned int, 4, std::allocator<unsigned int> >::storage_.absl::inlined_vector_internal::Storage<unsigned int, 4, std::allocator<unsigned int> >::data_' is used uninitialized [-Werror=uninitialized]
Steps to reproduce the problem
It's not easy to reproduce but somehow in google test framework you can hit it rather easy:
https://godbolt.org/z/4aMTYbWKG
Not all gcc versions will report it but 12 and 13 do and you will need optimization.
What version of Abseil are you using?
Seen in all 20220623 and 20240722. (and version that godbolt uses)
What operating system and version are you using?
Should not really mater here:
What compiler and version are you using?
What build system are you using?
Additional context
It's unclear if this is a compiler bug or technical correct as the
MemcpyFrom
function literately copies the uninitializeddata_
union.abseil-cpp/absl/container/internal/inlined_vector.h
Line 522 in 45c456b
The text was updated successfully, but these errors were encountered: