refactor: Remove locale-dependent function calls #156

pull ryanofsky wants to merge 1 commits into bitcoin-core:master from ryanofsky:pr/locale changing 7 files +23 −9
  1. ryanofsky commented at 3:31 pm on February 7, 2025: collaborator
    Changes suggested in https://github.com/bitcoin/bitcoin/pull/31741#discussion_r1942612485 to be able to enable more linters in Bitcoin Core CI.
  2. refactor: Remove locale-dependent function calls
    Changes suggested in
    https://github.com/bitcoin/bitcoin/pull/31741#discussion_r1942612485 to be able
    to enable more linters in Bitcoin Core CI.
    
    Co-authored-by: Ryan Ofsky <ryan@ofsky.org>
    c8351c5f0b
  3. ryanofsky force-pushed on Feb 7, 2025
  4. ryanofsky force-pushed on Feb 7, 2025
  5. ryanofsky commented at 4:39 pm on February 7, 2025: collaborator

    Had to increase c++ version from c++17 to c++20 to use std::format

    Updated 38459f174f198c852fe35259b34ffab9c33efc84 -> 6fb68977ca68f4f167ce8d5fce6151284fad2429 (pr/locale.1 -> pr/locale.2, compare) with compile fixes Updated 6fb68977ca68f4f167ce8d5fce6151284fad2429 -> c8351c5f0b706136a6e6b902eae3ef5e8a727c2e (pr/locale.2 -> pr/locale.3, compare) with other tweaks

  6. ryanofsky merged this on Feb 7, 2025
  7. ryanofsky closed this on Feb 7, 2025

  8. maflcko commented at 4:55 pm on February 7, 2025: contributor

    Had to increase c++ version from c++17 to c++20 to use std::format

    std::format isn’t available in g++12, or clang-16 either, so this could lead to issues later on?

    https://en.cppreference.com/w/cpp/compiler_support/20

  9. ryanofsky commented at 5:11 pm on February 7, 2025: collaborator

    std::format isn’t available in g++12, or clang-16 either, so this could lead to issues later on?

    Thanks, this is good to know. Can revert std::format changes if needed later. They are definitely non-essential.

  10. ryanofsky referenced this in commit 9437e6846f on Feb 7, 2025
  11. ryanofsky referenced this in commit eca8fd3eee on Feb 7, 2025
  12. ryanofsky referenced this in commit 408990787f on Feb 7, 2025
  13. ryanofsky referenced this in commit a4a8f7a7ba on Feb 7, 2025
  14. in src/mp/util.cpp:89 in c8351c5f0b
    85@@ -85,9 +86,7 @@ std::string LogEscape(const kj::StringTree& string)
    86             if (c == '\\') {
    87                 result.append("\\\\");
    88             } else if (c < 0x20 || c > 0x7e) {
    89-                char escape[4];
    90-                snprintf(escape, 4, "\\%02x", c);
    91-                result.append(escape);
    92+                result.append(std::format("\\{:02x}", c));
    


    hodlinator commented at 7:26 pm on February 7, 2025:
    Not sure std::format works with current Bitcoin Core head: https://github.com/bitcoin/bitcoin/blob/fb0ada982a73687520c43b8fde480fa5d456f3e1/doc/dependencies.md Clang 16 < 17 which is required for the full “Texture Formatting” feature set according to https://en.cppreference.com/w/cpp/compiler_support/20#C.2B.2B20_library_features Seems to check out on Godbolt: https://godbolt.org/z/9Ybd65f4d

    hodlinator commented at 7:28 pm on February 7, 2025:
    Oof, see now that maflcko beat me to it. :)
  15. ryanofsky referenced this in commit 3a95817ece on Feb 10, 2025
  16. Sjors referenced this in commit 6aabfcb615 on Feb 10, 2025
  17. Sjors referenced this in commit 1746618e08 on Feb 13, 2025
  18. ryanofsky referenced this in commit 83e40d3b52 on Feb 24, 2025
  19. ryanofsky referenced this in commit 8619f03ec2 on Feb 24, 2025
  20. ryanofsky referenced this in commit cbb7b41c20 on Feb 24, 2025
  21. fanquake referenced this in commit 01f7715766 on Feb 25, 2025
  22. fanquake referenced this in commit ba0a4391ff on Feb 25, 2025
  23. janus referenced this in commit 86cb86b050 on Sep 1, 2025

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/libmultiprocess. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-12-04 19:30 UTC

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