util: remove usage of `strerror_s/r` #36038

pull fanquake wants to merge 1 commits into bitcoin:master from fanquake:drop_strerror_r changing 4 files +4 −40
  1. fanquake commented at 2:27 PM on August 20, 2026: member

    Use std::system_category().message(err), which internally dispatches to strerror_r/s, and should handle unknown errors.

    See: https://github.com/llvm/llvm-project/blob/4e9e83400a5702059c8a18e2fb6174038875e8a6/libcxx/src/system_error.cpp#L231-L237 for one standard library implementation.

  2. DrahtBot added the label Utils/log/libs on Aug 20, 2026
  3. DrahtBot commented at 2:27 PM on August 20, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/36038.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

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

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. fanquake force-pushed on Aug 20, 2026
  5. DrahtBot added the label CI failed on Aug 20, 2026
  6. fanquake force-pushed on Aug 20, 2026
  7. util: remove usage of strerror_s/r
    Use std::system_category().message(err), which internally dispatches to
    strerror_r/s, and should handle unknown errors.
    
    See: https://github.com/llvm/llvm-project/blob/4e9e83400a5702059c8a18e2fb6174038875e8a6/libcxx/src/system_error.cpp#L231
    2227656a81
  8. in src/util/syserror.h:11 in 1ce27d26ea
       6 | @@ -7,9 +7,8 @@
       7 |  
       8 |  #include <string>
       9 |  
      10 | -/** Return system error string from errno value. Use this instead of
      11 | - * std::strerror, which is not thread-safe. For network errors use
      12 | - * NetworkErrorString from sock.h instead.
      13 | +/** Return system error string from errno value. For network errors
      14 | + * use NetworkErrorString from sock.h instead.
    


    maflcko commented at 2:42 PM on August 20, 2026:
    /// Return system error string from errno value. For network errors
    /// use NetworkErrorString from sock.h instead.
    

    nit: The different indent looks a bit ugly? Could use a fixed-size doxygen comment?


    fanquake commented at 2:55 PM on August 20, 2026:

    Sure, changed.

  9. fanquake force-pushed on Aug 20, 2026
  10. DrahtBot removed the label CI failed on Aug 20, 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-08-21 04:51 UTC

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