util, refactor: Switch to value-initialization #30040

pull hebasto wants to merge 1 commits into bitcoin:master from hebasto:240504-initialization changing 2 files +2 −2
  1. hebasto commented at 8:27 pm on May 4, 2024: member
    This PR allows to avoid false positive -Wmaybe-uninitialized warnings when cross-compiling for Windows.
  2. util, refactor: Switch to value-initialization
    This change allows to avoid false positive `-Wmaybe-uninitialized`
    warnings when cross-compiling for Windows.
    42df20ccb6
  3. DrahtBot commented at 8:27 pm on May 4, 2024: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage

    For detailed information about the code coverage, see the test coverage report.

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #30005 ([PoC, nomerge] PCP IPv4 portmap+IPv6 pinhole test by laanwj)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  4. DrahtBot added the label CI failed on May 4, 2024
  5. DrahtBot commented at 9:32 pm on May 4, 2024: contributor

    🚧 At least one of the CI tasks failed. Make sure to run all tests locally, according to the documentation.

    Possibly this is due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    Leave a comment here, if you need help tracking down a confusing failure.

    Debug: https://github.com/bitcoin/bitcoin/runs/24591151932

  6. fanquake commented at 1:42 am on May 5, 2024: member

    CI still failing:

     0In file included from ./hash.h:13,
     1                 from ./pubkey.h:10,
     2                 from ./addresstype.h:9,
     3                 from ./outputtype.h:9,
     4                 from outputtype.cpp:6:
     5In member function ‘bool prevector<N, T, Size, Diff>::is_direct() const [with unsigned int N = 28; T = unsigned char; Size = unsigned int; Diff = int]’,
     6    inlined from ‘prevector<N, T, Size, Diff>::~prevector() [with unsigned int N = 28; T = unsigned char; Size = unsigned int; Diff = int]’ at ./prevector.h:474:23,
     7    inlined from ‘CScript::~CScript()’ at ./script/script.h:413:7,
     8    inlined from ‘CNoDestination::~CNoDestination()’ at ./addresstype.h:18:7,
     9    inlined from ‘constexpr void std::destroy_at(_Tp*) [with _Tp = CNoDestination]’ at /usr/lib/gcc/x86_64-w64-mingw32/12-posix/include/c++/bits/stl_construct.h:88:18,
    10    inlined from ‘constexpr void std::_Destroy(_Tp*) [with _Tp = CNoDestination]’ at /usr/lib/gcc/x86_64-w64-mingw32/12-posix/include/c++/bits/stl_construct.h:149:22,
    11    inlined from ‘std::__detail::__variant::_Variant_storage<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>::_M_reset()::<lambda(auto:19&&)> mutable [with auto:19 = CNoDestination&]’ at /usr/lib/gcc/x86_64-w64-mingw32/12-posix/include/c++/variant:472:19,
    12    inlined from ‘constexpr _Res std::__invoke_impl(__invoke_other, _Fn&&, _Args&& ...) [with _Res = void; _Fn = __detail::__variant::_Variant_storage<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>::_M_reset()::<lambda(auto:19&&)>; _Args = {CNoDestination&}]’ at /usr/lib/gcc/x86_64-w64-mingw32/12-posix/include/c++/bits/invoke.h:61:36,
    13    inlined from ‘constexpr std::enable_if_t<is_invocable_r_v<_Res, _Callable, _Args ...>, _Res> std::__invoke_r(_Callable&&, _Args&& ...) [with _Res = void; _Callable = __detail::__variant::_Variant_storage<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>::_M_reset()::<lambda(auto:19&&)>; _Args = {CNoDestination&}]’ at /usr/lib/gcc/x86_64-w64-mingw32/12-posix/include/c++/bits/invoke.h:111:28,
    14    inlined from ‘static constexpr decltype(auto) std::__detail::__variant::__gen_vtable_impl<std::__detail::__variant::_Multi_array<_Result_type (*)(_Visitor, _Variants ...)>, std::integer_sequence<long long unsigned int, __indices ...> >::__visit_invoke(_Visitor&&, _Variants ...) [with _Result_type = void; _Visitor = std::__detail::__variant::_Variant_storage<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>::_M_reset()::<lambda(auto:19&&)>&&; _Variants = {std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>&}; long long unsigned int ...__indices = {0}]’ at /usr/lib/gcc/x86_64-w64-mingw32/12-posix/include/c++/variant:1035:40,
    15    inlined from ‘constexpr decltype(auto) std::__do_visit(_Visitor&&, _Variants&& ...) [with _Result_type = void; _Visitor = __detail::__variant::_Variant_storage<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>::_M_reset()::<lambda(auto:19&&)>; _Variants = {variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>&}]’ at /usr/lib/gcc/x86_64-w64-mingw32/12-posix/include/c++/variant:1783:5,
    16    inlined from ‘constexpr decltype(auto) std::__do_visit(_Visitor&&, _Variants&& ...) [with _Result_type = void; _Visitor = __detail::__variant::_Variant_storage<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>::_M_reset()::<lambda(auto:19&&)>; _Variants = {variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>&}]’ at /usr/lib/gcc/x86_64-w64-mingw32/12-posix/include/c++/variant:1729:5,
    17    inlined from ‘constexpr void std::__detail::__variant::_Variant_storage<false, _Types ...>::_M_reset() [with _Types = {CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown}]’ at /usr/lib/gcc/x86_64-w64-mingw32/12-posix/include/c++/variant:470:23,
    18    inlined from ‘constexpr std::__detail::__variant::_Variant_storage<false, _Types ...>::~_Variant_storage() [with _Types = {CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown}]’ at /usr/lib/gcc/x86_64-w64-mingw32/12-posix/include/c++/variant:480:17,
    19    inlined from ‘constexpr std::__detail::__variant::_Copy_ctor_base<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>::~_Copy_ctor_base()’ at /usr/lib/gcc/x86_64-w64-mingw32/12-posix/include/c++/variant:554:12,
    20    inlined from ‘constexpr std::__detail::__variant::_Move_ctor_base<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>::~_Move_ctor_base()’ at /usr/lib/gcc/x86_64-w64-mingw32/12-posix/include/c++/variant:591:12,
    21    inlined from ‘constexpr std::__detail::__variant::_Copy_assign_base<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>::~_Copy_assign_base()’ at /usr/lib/gcc/x86_64-w64-mingw32/12-posix/include/c++/variant:629:12,
    22    inlined from ‘constexpr std::__detail::__variant::_Move_assign_base<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>::~_Move_assign_base()’ at /usr/lib/gcc/x86_64-w64-mingw32/12-posix/include/c++/variant:681:12,
    23    inlined from ‘constexpr std::__detail::__variant::_Variant_base<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>::~_Variant_base()’ at /usr/lib/gcc/x86_64-w64-mingw32/12-posix/include/c++/variant:735:12,
    24    inlined from ‘constexpr std::variant<_Types>::~variant() [with _Types = {CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown}]’ at /usr/lib/gcc/x86_64-w64-mingw32/12-posix/include/c++/variant:1407:28,
    25    inlined from ‘std::vector<std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown> > GetAllDestinationsForKey(const CPubKey&)’ at outputtype.cpp:79:5:
    26./prevector.h:175:37: error: ‘*(const prevector<28, unsigned char, unsigned int, int>*)((char*)&p2sh + offsetof(std::CTxDestination, std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>::<unnamed>.std::__detail::__variant::_Variant_base<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>::<unnamed>.std::__detail::__variant::_Move_assign_base<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>::<unnamed>.std::__detail::__variant::_Copy_assign_base<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>::<unnamed>.std::__detail::__variant::_Move_ctor_base<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>::<unnamed>.std::__detail::__variant::_Copy_ctor_base<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>::<unnamed>.std::__detail::__variant::_Variant_storage<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>::_M_u)).prevector<28, unsigned char>::_size’ may be used uninitialized [-Werror=maybe-uninitialized]
    27  175 |     bool is_direct() const { return _size <= N; }
    28      |                                     ^~~~~
    29outputtype.cpp: In function ‘std::vector<std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown> > GetAllDestinationsForKey(const CPubKey&)’:
    30outputtype.cpp:77:24: note: ‘p2sh’ declared here
    31   77 |         CTxDestination p2sh = ScriptHash(GetScriptForDestination(segwit));
    32      |                        ^~~~
    33In file included from /usr/lib/gcc/x86_64-w64-mingw32/12-posix/include/c++/vector:64,
    34                 from ./serialize.h:26,
    35                 from ./hash.h:14:
    36In destructor ‘constexpr std::_Vector_base<_Tp, _Alloc>::~_Vector_base() [with _Tp = unsigned char; _Alloc = std::allocator<unsigned char>]’,
    37    inlined from ‘constexpr std::vector<_Tp, _Alloc>::~vector() [with _Tp = unsigned char; _Alloc = std::allocator<unsigned char>]’ at /usr/lib/gcc/x86_64-w64-mingw32/12-posix/include/c++/bits/stl_vector.h:733:7,
    38    inlined from ‘constexpr WitnessUnknown::~WitnessUnknown()’ at ./addresstype.h:94:8,
    39    inlined from ‘constexpr void std::destroy_at(_Tp*) [with _Tp = WitnessUnknown]’ at /usr/lib/gcc/x86_64-w64-mingw32/12-posix/include/c++/bits/stl_construct.h:88:18,
    40    inlined from ‘constexpr void std::_Destroy(_Tp*) [with _Tp = WitnessUnknown]’ at /usr/lib/gcc/x86_64-w64-mingw32/12-posix/include/c++/bits/stl_construct.h:149:22,
    41    inlined from ‘std::__detail::__variant::_Variant_storage<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>::_M_reset()::<lambda(auto:19&&)> mutable [with auto:19 = WitnessUnknown&]’ at /usr/lib/gcc/x86_64-w64-mingw32/12-posix/include/c++/variant:472:19,
    42    inlined from ‘constexpr _Res std::__invoke_impl(__invoke_other, _Fn&&, _Args&& ...) [with _Res = void; _Fn = __detail::__variant::_Variant_storage<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>::_M_reset()::<lambda(auto:19&&)>; _Args = {WitnessUnknown&}]’ at /usr/lib/gcc/x86_64-w64-mingw32/12-posix/include/c++/bits/invoke.h:61:36,
    43    inlined from ‘constexpr std::enable_if_t<is_invocable_r_v<_Res, _Callable, _Args ...>, _Res> std::__invoke_r(_Callable&&, _Args&& ...) [with _Res = void; _Callable = __detail::__variant::_Variant_storage<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>::_M_reset()::<lambda(auto:19&&)>; _Args = {WitnessUnknown&}]’ at /usr/lib/gcc/x86_64-w64-mingw32/12-posix/include/c++/bits/invoke.h:111:28,
    44    inlined from ‘static constexpr decltype(auto) std::__detail::__variant::__gen_vtable_impl<std::__detail::__variant::_Multi_array<_Result_type (*)(_Visitor, _Variants ...)>, std::integer_sequence<long long unsigned int, __indices ...> >::__visit_invoke(_Visitor&&, _Variants ...) [with _Result_type = void; _Visitor = std::__detail::__variant::_Variant_storage<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>::_M_reset()::<lambda(auto:19&&)>&&; _Variants = {std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>&}; long long unsigned int ...__indices = {7}]’ at /usr/lib/gcc/x86_64-w64-mingw32/12-posix/include/c++/variant:1035:40,
    45    inlined from ‘constexpr decltype(auto) std::__do_visit(_Visitor&&, _Variants&& ...) [with _Result_type = void; _Visitor = __detail::__variant::_Variant_storage<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>::_M_reset()::<lambda(auto:19&&)>; _Variants = {variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>&}]’ at /usr/lib/gcc/x86_64-w64-mingw32/12-posix/include/c++/variant:1790:5,
    46    inlined from ‘constexpr void std::__detail::__variant::_Variant_storage<false, _Types ...>::_M_reset() [with _Types = {CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown}]’ at /usr/lib/gcc/x86_64-w64-mingw32/12-posix/include/c++/variant:470:23,
    47    inlined from ‘constexpr std::__detail::__variant::_Variant_storage<false, _Types ...>::~_Variant_storage() [with _Types = {CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown}]’ at /usr/lib/gcc/x86_64-w64-mingw32/12-posix/include/c++/variant:480:17,
    48    inlined from ‘constexpr std::__detail::__variant::_Copy_ctor_base<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>::~_Copy_ctor_base()’ at /usr/lib/gcc/x86_64-w64-mingw32/12-posix/include/c++/variant:554:12,
    49    inlined from ‘constexpr std::__detail::__variant::_Move_ctor_base<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>::~_Move_ctor_base()’ at /usr/lib/gcc/x86_64-w64-mingw32/12-posix/include/c++/variant:591:12,
    50    inlined from ‘constexpr std::__detail::__variant::_Copy_assign_base<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>::~_Copy_assign_base()’ at /usr/lib/gcc/x86_64-w64-mingw32/12-posix/include/c++/variant:629:12,
    51    inlined from ‘constexpr std::__detail::__variant::_Move_assign_base<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>::~_Move_assign_base()’ at /usr/lib/gcc/x86_64-w64-mingw32/12-posix/include/c++/variant:681:12,
    52    inlined from ‘constexpr std::__detail::__variant::_Variant_base<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>::~_Variant_base()’ at /usr/lib/gcc/x86_64-w64-mingw32/12-posix/include/c++/variant:735:12,
    53    inlined from ‘constexpr std::variant<_Types>::~variant() [with _Types = {CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown}]’ at /usr/lib/gcc/x86_64-w64-mingw32/12-posix/include/c++/variant:1407:28,
    54    inlined from ‘std::vector<std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown> > GetAllDestinationsForKey(const CPubKey&)’ at outputtype.cpp:79:5:
    55/usr/lib/gcc/x86_64-w64-mingw32/12-posix/include/c++/bits/stl_vector.h:367:31: error: ‘*(std::_Vector_base<unsigned char, std::allocator<unsigned char> >*)((char*)&p2sh + offsetof(std::CTxDestination, std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>::<unnamed>.std::__detail::__variant::_Variant_base<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>::<unnamed>.std::__detail::__variant::_Move_assign_base<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>::<unnamed>.std::__detail::__variant::_Copy_assign_base<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>::<unnamed>.std::__detail::__variant::_Move_ctor_base<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>::<unnamed>.std::__detail::__variant::_Copy_ctor_base<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>::<unnamed>.std::__detail::__variant::_Variant_storage<false, CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown>::_M_u) + 8).std::_Vector_base<unsigned char, std::allocator<unsigned char> >::_M_impl.std::_Vector_base<unsigned char, std::allocator<unsigned char> >::_Vector_impl::<anonymous>.std::_Vector_base<unsigned char, std::allocator<unsigned char> >::_Vector_impl_data::_M_end_of_storage’ may be used uninitialized [-Werror=maybe-uninitialized]
    56  367 |                       _M_impl._M_end_of_storage - _M_impl._M_start);
    57      |                       ~~~~~~~~^~~~~~~~~~~~~~~~~
    58outputtype.cpp: In function ‘std::vector<std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown> > GetAllDestinationsForKey(const CPubKey&)’:
    59outputtype.cpp:77:24: note: ‘p2sh’ declared here
    60   77 |         CTxDestination p2sh = ScriptHash(GetScriptForDestination(segwit));
    61      |                        ^~~~
    
  7. hebasto marked this as a draft on May 5, 2024
  8. hebasto commented at 7:18 pm on May 5, 2024: member

    Closing.

    CI still failing:

    FWIW, those false positive warnings are fixed in GCC 13.

  9. hebasto closed this on May 5, 2024

  10. in src/util/strencodings.h:184 in 42df20ccb6
    180@@ -181,7 +181,7 @@ template <typename T>
    181 std::optional<T> ToIntegral(std::string_view str)
    182 {
    183     static_assert(std::is_integral<T>::value);
    184-    T result;
    185+    T result{};
    


    laanwj commented at 7:23 pm on May 5, 2024:
    Concept ACK on adding value initialization here, seems like a good precaution in any case.

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: 2024-12-21 15:12 UTC

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