-Wmaybe-uninitialized warnings under LTO #27343

issue fanquake opened this issue on March 27, 2023
  1. fanquake commented at 1:43 PM on March 27, 2023: member

    Building under GCC 14.0.1 with -flto (Fedora Rawhide) currently results in a number of -Wmaybe-uninitialized warnings. Some of these are things we might not want to "fix", i.e in test code. Some come from leveldb etc. Open this issue to document them, as some exist with current versions of GCC, and GCC 14.0 will be released soon:

    leveldb/db/memtable.cc: In function 'GetLengthPrefixedSlice':
    leveldb/db/memtable.cc:18:22: warning: 'len' may be used uninitialized [-Wmaybe-uninitialized]
       18 |   return Slice(p, len);
          |                      ^
    leveldb/db/memtable.cc:15:12: note: 'len' was declared here
       15 |   uint32_t len;
          |            ^
    In function 'GetLengthPrefixedSlice',
        inlined from 'operator()' at leveldb/db/memtable.cc:32:35,
        inlined from 'KeyIsAfterNode' at ./leveldb/db/skiplist.h:257:37,
        inlined from 'FindGreaterOrEqual' at ./leveldb/db/skiplist.h:268:23:
    leveldb/db/memtable.cc:18:22: warning: 'len' may be used uninitialized [-Wmaybe-uninitialized]
       18 |   return Slice(p, len);
          |                      ^
    leveldb/db/memtable.cc: In member function 'FindGreaterOrEqual':
    leveldb/db/memtable.cc:15:12: note: 'len' was declared here
       15 |   uint32_t len;
          |            ^
    leveldb/db/memtable.cc: In member function 'Get':
    leveldb/db/memtable.cc:119:39: warning: 'key_length' may be used uninitialized [-Wmaybe-uninitialized]
      119 |             Slice(key_ptr, key_length - 8), key.user_key()) == 0) {
          |                                       ^
    leveldb/db/memtable.cc:116:14: note: 'key_length' was declared here
      116 |     uint32_t key_length;
          |              ^
    In member function 'operator=',
        inlined from '__ct ' at test/prevector_tests.cpp:215:49,
        inlined from 'test_method.isra' at test/prevector_tests.cpp:222:34:
    random.cpp:749:19: warning: 'D.58376.bitbuf' is used uninitialized [-Wuninitialized]
      749 |     bitbuf = from.bitbuf;
          |                   ^
    test/prevector_tests.cpp: In function 'test_method.isra':
    test/prevector_tests.cpp:215:22: note: '<anonymous>' declared here
      215 |         rand_cache = FastRandomContext(rand_seed);
          |                      ^
    leveldb/db/memtable.cc: In function 'GetLengthPrefixedSlice':
    leveldb/db/memtable.cc:18:22: warning: 'len' may be used uninitialized [-Wmaybe-uninitialized]
       18 |   return Slice(p, len);
          |                      ^
    leveldb/db/memtable.cc:15:12: note: 'len' was declared here
       15 |   uint32_t len;
          |            ^
    leveldb/db/memtable.cc: In function 'GetLengthPrefixedSlice':
    leveldb/db/memtable.cc:18:22: warning: 'len' may be used uninitialized [-Wmaybe-uninitialized]
       18 |   return Slice(p, len);
          |                      ^
    leveldb/db/memtable.cc:15:12: note: 'len' was declared here
       15 |   uint32_t len;
          |            ^
    In function 'GetLengthPrefixedSlice',
        inlined from 'operator()' at leveldb/db/memtable.cc:32:35,
        inlined from 'KeyIsAfterNode' at ./leveldb/db/skiplist.h:257:37,
        inlined from 'FindGreaterOrEqual' at ./leveldb/db/skiplist.h:268:23:
    leveldb/db/memtable.cc:18:22: warning: 'len' may be used uninitialized [-Wmaybe-uninitialized]
       18 |   return Slice(p, len);
          |                      ^
    leveldb/db/memtable.cc: In member function 'FindGreaterOrEqual':
    leveldb/db/memtable.cc:15:12: note: 'len' was declared here
       15 |   uint32_t len;
          |            ^
    In function 'GetLengthPrefixedSlice',
        inlined from 'operator()' at leveldb/db/memtable.cc:32:35,
        inlined from 'KeyIsAfterNode' at ./leveldb/db/skiplist.h:257:37,
        inlined from 'FindGreaterOrEqual' at ./leveldb/db/skiplist.h:268:23:
    leveldb/db/memtable.cc:18:22: warning: 'len' may be used uninitialized [-Wmaybe-uninitialized]
       18 |   return Slice(p, len);
          |                      ^
    leveldb/db/memtable.cc: In member function 'FindGreaterOrEqual':
    leveldb/db/memtable.cc:15:12: note: 'len' was declared here
       15 |   uint32_t len;
          |            ^
    leveldb/db/memtable.cc: In member function 'Get':
    leveldb/db/memtable.cc:119:39: warning: 'key_length' may be used uninitialized [-Wmaybe-uninitialized]
      119 |             Slice(key_ptr, key_length - 8), key.user_key()) == 0) {
          |                                       ^
    leveldb/db/memtable.cc:116:14: note: 'key_length' was declared here
      116 |     uint32_t key_length;
          |              ^
    In member function 'operator=',
        inlined from 'Seed.constprop' at test/util/random.cpp:32:33:
    random.cpp:749:19: warning: 'D.69037.bitbuf' may be used uninitialized [-Wmaybe-uninitialized]
      749 |     bitbuf = from.bitbuf;
          |                   ^
    test/util/random.cpp: In function 'Seed.constprop':
    test/util/random.cpp:32:33: note: '<anonymous>' declared here
       32 |     ctx = FastRandomContext(seed);
          |                                 ^
    leveldb/db/memtable.cc: In member function 'Get':
    leveldb/db/memtable.cc:119:39: warning: 'key_length' may be used uninitialized [-Wmaybe-uninitialized]
      119 |             Slice(key_ptr, key_length - 8), key.user_key()) == 0) {
          |                                       ^
    leveldb/db/memtable.cc:116:14: note: 'key_length' was declared here
      116 |     uint32_t key_length;
          |              ^
    In member function 'operator=',
        inlined from 'Seed' at test/util/random.cpp:32:33,
        inlined from 'SeedInsecureRand' at ./test/util/random.h:41:13,
        inlined from '__ct_base ' at test/util/setup_common.cpp:184:21:
    random.cpp:749:19: warning: 'D.40691.bitbuf' may be used uninitialized [-Wmaybe-uninitialized]
      749 |     bitbuf = from.bitbuf;
          |                   ^
    test/util/random.cpp: In member function '__ct_base ':
    test/util/random.cpp:32:33: note: '<anonymous>' declared here
       32 |     ctx = FastRandomContext(seed);
          |                                 ^
    leveldb/db/memtable.cc: In function 'GetLengthPrefixedSlice':
    leveldb/db/memtable.cc:18:22: warning: 'len' may be used uninitialized [-Wmaybe-uninitialized]
       18 |   return Slice(p, len);
          |                      ^
    leveldb/db/memtable.cc:15:12: note: 'len' was declared here
       15 |   uint32_t len;
          |            ^
    In function 'GetLengthPrefixedSlice',
        inlined from 'operator()' at leveldb/db/memtable.cc:32:35,
        inlined from 'KeyIsAfterNode' at ./leveldb/db/skiplist.h:257:37,
        inlined from 'FindGreaterOrEqual' at ./leveldb/db/skiplist.h:268:23:
    leveldb/db/memtable.cc:18:22: warning: 'len' may be used uninitialized [-Wmaybe-uninitialized]
       18 |   return Slice(p, len);
          |                      ^
    leveldb/db/memtable.cc: In member function 'FindGreaterOrEqual':
    leveldb/db/memtable.cc:15:12: note: 'len' was declared here
       15 |   uint32_t len;
          |            ^
    leveldb/db/memtable.cc: In member function 'Get':
    leveldb/db/memtable.cc:119:39: warning: 'key_length' may be used uninitialized [-Wmaybe-uninitialized]
      119 |             Slice(key_ptr, key_length - 8), key.user_key()) == 0) {
          |                                       ^
    leveldb/db/memtable.cc:116:14: note: 'key_length' was declared here
      116 |     uint32_t key_length;
          |              ^
    test/fuzz/float.cpp: In function 'float_fuzz_target':
    test/fuzz/float.cpp:49:40: warning: 'tmp' may be used uninitialized [-Wmaybe-uninitialized]
       49 |         uint64_t encoded = EncodeDouble(d);
          |                                        ^
    test/fuzz/float.cpp:21:20: note: 'tmp' was declared here
       21 |             double tmp;
          |                    ^
    In member function 'operator=',
        inlined from 'operator()' at test/fuzz/addrman.cpp:127:9,
        inlined from '__ct ' at test/fuzz/addrman.cpp:127:9,
        inlined from 'addrman_serdeser_fuzz_target' at test/fuzz/addrman.cpp:295:69:
    random.cpp:749:19: warning: 'D.36455.bitbuf' may be used uninitialized [-Wmaybe-uninitialized]
      749 |     bitbuf = from.bitbuf;
          |                   ^
    test/fuzz/addrman.cpp: In function 'addrman_serdeser_fuzz_target':
    test/fuzz/addrman.cpp:127:9: note: '<anonymous>' declared here
      127 |         WITH_LOCK(m_impl->cs, m_impl->insecure_rand = FastRandomContext{ConsumeUInt256(fuzzed_data_provider)});
          |         ^
    In member function 'operator=',
        inlined from 'operator()' at test/fuzz/addrman.cpp:127:9,
        inlined from '__ct ' at test/fuzz/addrman.cpp:127:9,
        inlined from 'addrman_serdeser_fuzz_target' at test/fuzz/addrman.cpp:296:69:
    random.cpp:749:19: warning: 'D.36632.bitbuf' may be used uninitialized [-Wmaybe-uninitialized]
      749 |     bitbuf = from.bitbuf;
          |                   ^
    test/fuzz/addrman.cpp: In function 'addrman_serdeser_fuzz_target':
    test/fuzz/addrman.cpp:127:9: note: '<anonymous>' declared here
      127 |         WITH_LOCK(m_impl->cs, m_impl->insecure_rand = FastRandomContext{ConsumeUInt256(fuzzed_data_provider)});
          |         ^
    In member function 'operator=',
        inlined from 'SeedInsecureRand' at ./test/util/random.h:39:72,
        inlined from 'SeedInsecureRand' at ./test/util/random.h:36:20,
        inlined from 'test_method' at test/cuckoocache_tests.cpp:40:21,
        inlined from 'test_cuckoocache_no_fakes_invoker' at test/cuckoocache_tests.cpp:38:1:
    random.cpp:749:19: warning: 'D.46810.bitbuf' may be used uninitialized [-Wmaybe-uninitialized]
      749 |     bitbuf = from.bitbuf;
          |                   ^
    ./test/util/random.h: In function 'test_cuckoocache_no_fakes_invoker':
    ./test/util/random.h:39:72: note: '<anonymous>' declared here
       39 |         g_insecure_rand_ctx = FastRandomContext(/*fDeterministic=*/true);
          |                                                                        ^
    In member function 'operator=',
        inlined from 'SeedInsecureRand' at ./test/util/random.h:39:72,
        inlined from 'SeedInsecureRand' at ./test/util/random.h:36:20,
        inlined from 'test_cache' at test/cuckoocache_tests.cpp:58:21,
        inlined from 'test_method' at test/cuckoocache_tests.cpp:117:84,
        inlined from 'cuckoocache_hit_rate_ok_invoker' at test/cuckoocache_tests.cpp:109:1:
    random.cpp:749:19: warning: 'D.48398.bitbuf' may be used uninitialized [-Wmaybe-uninitialized]
      749 |     bitbuf = from.bitbuf;
          |                   ^
    ./test/util/random.h: In function 'cuckoocache_hit_rate_ok_invoker':
    ./test/util/random.h:39:72: note: '<anonymous>' declared here
       39 |         g_insecure_rand_ctx = FastRandomContext(/*fDeterministic=*/true);
          |                                                                        ^
    In member function 'operator=',
        inlined from 'SeedInsecureRand' at ./test/util/random.h:39:72,
        inlined from 'SeedInsecureRand' at ./test/util/random.h:36:20,
        inlined from 'test_cache_erase' at test/cuckoocache_tests.cpp:129:21,
        inlined from 'test_method' at test/cuckoocache_tests.cpp:185:72,
        inlined from 'cuckoocache_erase_ok_invoker' at test/cuckoocache_tests.cpp:182:1:
    random.cpp:749:19: warning: 'D.50490.bitbuf' may be used uninitialized [-Wmaybe-uninitialized]
      749 |     bitbuf = from.bitbuf;
          |                   ^
    ./test/util/random.h: In function 'cuckoocache_erase_ok_invoker':
    ./test/util/random.h:39:72: note: '<anonymous>' declared here
       39 |         g_insecure_rand_ctx = FastRandomContext(/*fDeterministic=*/true);
          |                                                                        ^
    In function '__fill_a1',
        inlined from '__fill_a1' at /usr/include/c++/14/bits/stl_algobase.h:981:21,
        inlined from '__fill_a' at /usr/include/c++/14/bits/stl_algobase.h:998:21,
        inlined from 'fill' at /usr/include/c++/14/bits/stl_algobase.h:1029:20,
        inlined from 'PollutePubKey' at wallet/test/wallet_tests.cpp:503:14:
    /usr/include/c++/14/bits/stl_algobase.h:952:18: warning: '__builtin_memset' specified bound 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
      952 |         *__first = __tmp;
          |                  ^
    In member function 'operator=',
        inlined from 'SeedInsecureRand' at ./test/util/random.h:39:0,
        inlined from 'test_method' at test/util_tests.cpp:448:21,
        inlined from 'util_seed_insecure_rand_invoker' at test/util_tests.cpp:446:1:
    random.cpp:749:19: warning: 'D.49511.bitbuf' may be used uninitialized [-Wmaybe-uninitialized]
      749 |     bitbuf = from.bitbuf;
          |                   ^
    ./test/util/random.h: In function 'util_seed_insecure_rand_invoker':
    ./test/util/random.h:39: note: '<anonymous>' declared here
       39 |         g_insecure_rand_ctx = FastRandomContext(/*fDeterministic=*/true);
    In member function 'operator=',
        inlined from 'operator()' at test/fuzz/addrman.cpp:127:9,
        inlined from '__ct ' at test/fuzz/addrman.cpp:127:9,
        inlined from 'make_unique' at /usr/include/c++/14/bits/unique_ptr.h:1076:30,
        inlined from 'addrman_fuzz_target' at test/fuzz/addrman.cpp:228:97:
    random.cpp:749:19: warning: 'D.38104.bitbuf' may be used uninitialized [-Wmaybe-uninitialized]
      749 |     bitbuf = from.bitbuf;
          |                   ^
    test/fuzz/addrman.cpp: In function 'addrman_fuzz_target':
    test/fuzz/addrman.cpp:127:9: note: '<anonymous>' declared here
      127 |         WITH_LOCK(m_impl->cs, m_impl->insecure_rand = FastRandomContext{ConsumeUInt256(fuzzed_data_provider)});
          |         ^
    In member function 'operator=',
        inlined from 'operator()' at test/fuzz/addrman.cpp:127:9,
        inlined from '__ct ' at test/fuzz/addrman.cpp:127:9,
        inlined from 'make_unique' at /usr/include/c++/14/bits/unique_ptr.h:1076:30,
        inlined from 'addrman_fuzz_target' at test/fuzz/addrman.cpp:235:66:
    random.cpp:749:19: warning: 'D.41251.bitbuf' may be used uninitialized [-Wmaybe-uninitialized]
      749 |     bitbuf = from.bitbuf;
          |                   ^
    test/fuzz/addrman.cpp: In function 'addrman_fuzz_target':
    test/fuzz/addrman.cpp:127:9: note: '<anonymous>' declared here
      127 |         WITH_LOCK(m_impl->cs, m_impl->insecure_rand = FastRandomContext{ConsumeUInt256(fuzzed_data_provider)});
          |         ^
    In member function 'operator=',
        inlined from 'Seed' at test/util/random.cpp:32:33,
        inlined from 'SeedInsecureRand' at ./test/util/random.h:41:13,
        inlined from '__ct_base ' at test/util/setup_common.cpp:184:21:
    random.cpp:749:19: warning: 'D.39055.bitbuf' may be used uninitialized [-Wmaybe-uninitialized]
      749 |     bitbuf = from.bitbuf;
          |                   ^
    test/util/random.cpp: In member function '__ct_base ':
    test/util/random.cpp:32:33: note: '<anonymous>' declared here
       32 |     ctx = FastRandomContext(seed);
          |                                 ^
    In member function 'operator=',
        inlined from 'test_method' at test/orphanage_tests.cpp:57:56,
        inlined from 'DoS_mapOrphans_invoker' at test/orphanage_tests.cpp:49:1:
    random.cpp:749:19: warning: 'D.45887.bitbuf' may be used uninitialized [-Wmaybe-uninitialized]
      749 |     bitbuf = from.bitbuf;
          |                   ^
    test/orphanage_tests.cpp: In function 'DoS_mapOrphans_invoker':
    test/orphanage_tests.cpp:57:56: note: '<anonymous>' declared here
       57 |     g_insecure_rand_ctx = FastRandomContext{uint256{33}};
          |                                                        ^
    In member function '__ct ',
        inlined from 'construct_at' at /usr/include/c++/14/bits/stl_construct.h:97:14,
        inlined from 'construct' at /usr/include/c++/14/bits/alloc_traits.h:536:21,
        inlined from '_M_realloc_append' at /usr/include/c++/14/bits/vector.tcc:634:26,
        inlined from 'emplace_back' at /usr/include/c++/14/bits/vector.tcc:123:21,
        inlined from 'test_method' at test/logging_tests.cpp:166:45,
        inlined from 'logging_LogPrintMacros_CategoryName_invoker' at test/logging_tests.cpp:156:1:
    /usr/include/c++/14/bits/stl_pair.h:444:11: warning: 'category' may be used uninitialized [-Wmaybe-uninitialized]
      444 |         : first(std::forward<_U1>(__x)), second(std::forward<_U2>(__y))
          |           ^
    test/logging_tests.cpp: In function 'logging_LogPrintMacros_CategoryName_invoker':
    test/logging_tests.cpp:163:25: note: 'category' was declared here
      163 |         BCLog::LogFlags category;
          |                         ^
    
    
  2. maflcko commented at 2:09 PM on March 27, 2023: member
  3. fanquake commented at 11:23 AM on March 28, 2023: member

    Fuzz ones removed in #27344

    Thanks. Retested at 8d31d769b7b504104f162a03c94bbc95dec7d849 and updated the op to drop those (other than in float).

  4. maflcko commented at 11:38 AM on March 28, 2023: member

    Yeah, that is a false positive. Not sure if gcc are going to fix it, but if you want to work around, you can try something like:

    diff --git a/src/test/fuzz/float.cpp b/src/test/fuzz/float.cpp
    index 8714ab8a04..57f8d4cec8 100644
    --- a/src/test/fuzz/float.cpp
    +++ b/src/test/fuzz/float.cpp
    @@ -7,11 +7,13 @@
     #include <test/fuzz/fuzz.h>
     #include <test/fuzz/util.h>
     #include <util/serfloat.h>
    +#include <util/check.h>
     #include <version.h>
     
     #include <cassert>
     #include <cmath>
     #include <limits>
    +#include <optional>
     
     FUZZ_TARGET(float)
     {
    @@ -19,7 +21,7 @@ FUZZ_TARGET(float)
     
         {
             const double d{[&] {
    -            double tmp;
    +            std::optional<double> tmp;
                 CallOneOf(
                     fuzzed_data_provider,
                     // an actual number
    @@ -43,7 +45,7 @@ FUZZ_TARGET(float)
                           }); },
                     // Anything from raw memory (also checks that DecodeDouble doesn't crash on any input)
                     [&] { tmp = DecodeDouble(fuzzed_data_provider.ConsumeIntegral<uint64_t>()); });
    -            return tmp;
    +            return *Assert(tmp);
             }()};
             (void)memusage::DynamicUsage(d);
     
    
  5. fanquake commented at 11:06 AM on May 3, 2023: member

    Using master (49d543dcaf6ac1b71f8d607dab464a39aff837ac) & GCC 11.3.0 & LTO:

    ./univalue/include/univalue.h: In member function 'getInt':
    ./univalue/include/univalue.h:146:12: warning: 'result' may be used uninitialized in this function [-Wmaybe-uninitialized]
      146 |     return result;
          |            ^
    ./univalue/include/univalue.h:141:9: note: 'result' was declared here
      141 |     Int result;
          |         ^
    ./univalue/include/univalue.h: In member function 'getInt':
    ./univalue/include/univalue.h:146:12: warning: 'result' may be used uninitialized in this function [-Wmaybe-uninitialized]
      146 |     return result;
          |            ^
    ./univalue/include/univalue.h:141:9: note: 'result' was declared here
      141 |     Int result;
          |         ^
    

    Noting here incase it gets reported.

  6. maflcko commented at 11:42 AM on May 3, 2023: member

    My previous reply should be valid for that one as well

  7. fanquake commented at 11:52 AM on May 3, 2023: member

    Yea. I don't really have an intention of fixing these ones, just keeping tabs so that if they do get reported, we can point to a thread.

  8. fanquake commented at 9:40 AM on March 21, 2024: member

    Updated op for GCC 14.0.1. Mostly just the same output.

  9. willcl-ark added the label Build system on Jan 16, 2026
  10. willcl-ark commented at 10:26 AM on January 16, 2026: member

    Is this still an issue worth keeping open? I have tried using:

    FROM fedora:rawhide
    
    RUN dnf install -y \
        gcc14 \
        gcc14-c++ \
        cmake \
        make \
        python3 \
        libevent-devel \
        boost-devel \
        sqlite-devel \
        git \
        && dnf clean all
    
    ENV CC=gcc-14
    ENV CXX=g++-14
    
    RUN git clone --depth=1 https://github.com/bitcoin/bitcoin.git /bitcoin
    
    WORKDIR /bitcoin
    
    RUN cmake -B build -DENABLE_IPC=FALSE -DCMAKE_C_FLAGS="-flto" -DCMAKE_CXX_FLAGS="-flto" \
        && cmake --build build --parallel
    

    ...which installs gcc 14.3.1:

    [#8](/bitcoin-bitcoin/8/) 9.737 C++ compiler .......................... GNU 14.3.1, /usr/sbin/g++-14
    [#8](/bitcoin-bitcoin/8/) 9.737 CMAKE_BUILD_TYPE ...................... RelWithDebInfo
    [#8](/bitcoin-bitcoin/8/) 9.738 Preprocessor defined macros ...........
    [#8](/bitcoin-bitcoin/8/) 9.738 C++ compiler flags .................... -flto -O2 -g -std=c++20 -fPIC -fno-extended-identifiers -fdebug-prefix-map=/bitcoin/src=. -fmacro-prefix-map=/bitcoin/src=. -fstack-reuse=none -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -Wstack-protector -fstack-protector-all -fcf-protection=full -fstack-clash-protection -Wall -Wextra -Wformat -Wformat-security -Wvla -Wredundant-decls -Wdate-time -Wduplicated-branches -Wduplicated-cond -Wlogical-op -Woverloaded-virtual -Wsuggest-override -Wimplicit-fallthrough -Wunreachable-code -Wbidi-chars=any -Wundef -Wno-unused-parameter
    [#8](/bitcoin-bitcoin/8/) 9.738 Linker flags .......................... -flto -O2 -g -fstack-reuse=none -fstack-protector-all -fcf-protection=full -fstack-clash-protection -Wl,-z,relro -Wl,-z,now -Wl,-z,separate-code -fPIE -pie
    

    and, with the exception of some lto warnings:

    [#8](/bitcoin-bitcoin/8/) 100.0 [ 99%] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/__/wallet/test/wallet_transaction_tests.cpp.o
    [#8](/bitcoin-bitcoin/8/) 119.5 lto-wrapper: warning: using serial compilation of 20 LTRANS jobs
    [#8](/bitcoin-bitcoin/8/) 119.5 lto-wrapper: note: see the '-flto' option documentation for more information
    [#8](/bitcoin-bitcoin/8/) 126.5 [ 99%] Built target bitcoin
    [#8](/bitcoin-bitcoin/8/) 148.5 [ 99%] Linking CXX executable ../bin/bitcoind
    [#8](/bitcoin-bitcoin/8/) 151.0 [ 99%] Built target bitcoin-util
    c#8 163.9 [100%] Linking CXX executable ../bin/bitcoin-wallet
    [#8](/bitcoin-bitcoin/8/) 168.9 [100%] Built target bitcoin-cli
    [#8](/bitcoin-bitcoin/8/) 169.1 lto-wrapper: warning: using serial compilation of 37 LTRANS jobs
    [#8](/bitcoin-bitcoin/8/) 169.1 lto-wrapper: note: see the '-flto' option documentation for more information
    [#8](/bitcoin-bitcoin/8/) 169.8 [100%] Linking CXX executable ../../bin/test_bitcoin
    [#8](/bitcoin-bitcoin/8/) 173.3 lto-wrapper: warning: using serial compilation of 128 LTRANS jobs
    [#8](/bitcoin-bitcoin/8/) 173.3 lto-wrapper: note: see the '-flto' option documentation for more information
    [#8](/bitcoin-bitcoin/8/) 184.8 [100%] Built target bitcoin-tx
    [#8](/bitcoin-bitcoin/8/) 186.0 lto-wrapper: warning: using serial compilation of 128 LTRANS jobs
    [#8](/bitcoin-bitcoin/8/) 186.0 lto-wrapper: note: see the '-flto' option documentation for more information
    [#8](/bitcoin-bitcoin/8/) 212.3 [100%] Built target bitcoin-wallet
    [#8](/bitcoin-bitcoin/8/) 334.0 [100%] Built target bitcoind
    [#8](/bitcoin-bitcoin/8/) 485.2 [100%] Built target test_bitcoin
    [#8](/bitcoin-bitcoin/8/) DONE 485.3s
    

    I don't see the -Wmaybe-uninitialized warnings any more.

    unrelated: whew lto really takes a long while!

  11. maflcko added the label Upstream on Jan 16, 2026
  12. maflcko commented at 10:37 AM on January 16, 2026: member

    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24639 is pretty filled, so I don't expect those warnings to generally go away any time soon. I think we can just point to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24639 if someone complains, but I'd presume that no user is using LTO, is there one?

  13. fanquake commented at 11:05 AM on January 16, 2026: member

    Yea I think it's fine to close. There are still various warnings, depending on the target, but not much for us to do. FWIW I am building with LTO fairly often.

  14. fanquake closed this on Jan 16, 2026


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-26 06:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me