build: Build warnings from deprecated std::get_temporary_buffer in std::stable_sort calls #33080

issue enirox001 openend this issue on July 28, 2025
  1. enirox001 commented at 3:42 pm on July 28, 2025: contributor

    Is there an existing issue for this?

    • I have searched the existing issues

    Current behaviour

    Clang 20 generates deprecation warnings when std::stable_sort internally calls std::get_temporary_buffer (deprecated in C++17, removed in C++26).

    Expected behaviour

    Clean builds without deprecation warnings.

    Steps to reproduce

    Compile with Clang 20 (observed during fuzz build):

    0cmake --preset=libfuzzer
    1cmake --build build_fuzz
    

    Relevant log output

    0warning: 'get_temporary_buffer<std::shared_ptr<wallet::COutput>>' is deprecated [-Wdeprecated-declarations]
    1        std::stable_sort(vCoins.begin(), vCoins.end(), [&](const std::shared_ptr<COutput>& a, const std::shared_ptr<COutput>& b) {
    2                        ^
    3/usr/include/c++/v1/__algorithm/stable_sort.h:123:31: note: 'get_temporary_buffer<std::shared_ptr<wallet::COutput>>' has been explicitly marked deprecated here
    4    auto __buf = _VSTD::get_temporary_buffer<value_type>(__len);
    5                              ^
    

    How did you obtain Bitcoin Core

    Compiled from source

    What version of Bitcoin Core are you using?

    master

    Operating system and version

    Ubuntu/Debian

    Machine specifications

    No response

  2. enirox001 renamed this:
    Build warnings from deprecated std::get_temporary_buffer in std::stable_sort calls
    build: Build warnings from deprecated std::get_temporary_buffer in std::stable_sort calls
    on Jul 28, 2025
  3. maflcko added the label Upstream on Jul 29, 2025
  4. maflcko commented at 6:35 am on July 29, 2025: member
    Pretty sure this was already fixed upstream in GCC stdlib ? What are the exact steps to reproduce and what is your GCC version? It does not happen in the CI, looking at https://github.com/bitcoin/bitcoin/actions/runs/16582003563/job/46899945634?pr=32989
  5. enirox001 commented at 12:34 pm on July 29, 2025: contributor

    Thanks for looking into this. To clarify - I’m actually using Clang 20.1.8, not GCC. The GCC paths in the warnings are because Clang uses the system’s GCC standard library headers on Linux.

    Exact reproduction steps:

    1. cmake --preset=libfuzzer
    2. cmake --build build_fuzz

    System: Ubuntu 22.04, Clang 20.1.8

    The warnings appear specifically with this libfuzzer preset configuration. If this turns out to be a Clang-specific issue or already resolved upstream, I understand it may not be worth addressing.

  6. maflcko commented at 12:51 pm on July 29, 2025: member
    This warning is harmless and can be ignored. It should go away the next time you upgrade your Ubuntu (and thus the GCC package and std lib). Alternatively, you can use libc++ instead.
  7. maflcko added the label Questions and Help on Jul 29, 2025
  8. enirox001 closed this on Jul 29, 2025


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: 2025-08-05 03:13 UTC

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