Use type-safe formatting for strprintf and logging #3549

pull laanwj wants to merge 2 commits into bitcoin:master from laanwj:2014_01_tinyformat changing 26 files +1299 −338
  1. laanwj commented at 3:59 PM on January 16, 2014: member

    Switch to tinyformat-based formatting. Alternative to #3271.

    Tinyformat is a typesafe drop-in replacement for C99 printf functions: https://github.com/c42f/tinyformat

    Removes need for real_strprintf and other macro hacks. Also removes the need for the -D__USE_MINGW_ANSI_STDIO hack for mingw.

    Second commit removes now-redundant c_str()s as the new formatting function can take std::strings directly. This commit has a much larger diff and is optional. It's just a cleanup.

    Edit: should also fix "gnu_printf" warnings when building for MacOSX

  2. sipa commented at 7:39 PM on January 16, 2014: member

    ACK, both commits. Seems to work fine.

  3. kiddouk commented at 10:15 AM on January 23, 2014: none

    Just tested with LLVM, the patch is working correctly.

    $> g++ --version                                                                                                                                     [10:59]
    Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
    Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
    Target: x86_64-apple-darwin13.0.0
    Thread model: posix
    
  4. Typesafe strprintf/error/LogPrint functions
    Switch to tinyformat-based formatting.
    
    Tinyformat is a typesafe drop-in replacement for C99 printf functions:
    https://github.com/c42f/tinyformat
    b77dfdc9e3
  5. Remove redundant .c_str()s
    After the tinyformat switch sprintf() family functions support passing
    actual std::string objects.
    
    Remove unnecessary c_str calls (236 of them) in logging and formatting.
    7d9d134bf9
  6. BitcoinPullTester commented at 3:36 PM on January 23, 2014: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/7d9d134bf95cb6a2ce9623c7e6a3535432a61af2 for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.

  7. laanwj referenced this in commit 6403c6c835 on Jan 23, 2014
  8. laanwj merged this on Jan 23, 2014
  9. laanwj closed this on Jan 23, 2014

  10. laanwj deleted the branch on Apr 9, 2014
  11. DrahtBot locked this on Sep 8, 2021

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-13 18:16 UTC

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