refactor: Fix bugprone-string-constructor warning #28741

pull maflcko wants to merge 1 commits into bitcoin:master from maflcko:2310-bugprone-string-constructor- changing 2 files +3 −2
  1. maflcko commented at 1:28 pm on October 27, 2023: member

    String literals in C++ have a trailing null character, so the current code is fine to rely on that implicitly. However,

    • the sqlite documentation explicitly mentions the null character
    • code readers may wonder if the code is intentional
    • clang-tidy warns about the code via bugprone-string-constructor

    Address the points by putting the null character into the code and enable the clang-tidy bugprone-string-constructor check.

  2. DrahtBot commented at 1:28 pm on October 27, 2023: 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.

    Type Reviewers
    ACK stickies-v
    Stale ACK pablomartin4btc

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  3. DrahtBot added the label Refactoring on Oct 27, 2023
  4. in src/wallet/db.cpp:132 in fa3b6ef3c7 outdated
    130@@ -131,7 +131,7 @@ bool IsSQLiteFile(const fs::path& path)
    131 
    132     // Check the magic, see https://sqlite.org/fileformat2.html
    


    pablomartin4btc commented at 11:42 pm on October 27, 2023:

    nit: checking the documentation where explicitly mentions the required null character, found that the correct url would be…

    0    // Check the magic, see https://sqlite.org/fileformat.html
    

    maflcko commented at 2:00 pm on October 30, 2023:
    done

    stickies-v commented at 2:57 pm on October 30, 2023:

    reviewer note: both links are (currently) equivalent:

    0% wget https://sqlite.org/fileformat.html
    1% wget https://sqlite.org/fileformat2.html
    2% diff -U 0 fileformat.html fileformat2.html | grep ^@ | wc -l
    3       0
    
  5. pablomartin4btc approved
  6. pablomartin4btc commented at 11:42 pm on October 27, 2023: member
    ACK fa3b6ef3c736063a5d7e12456aacfc545a818d63
  7. refactor: Fix bugprone-string-constructor warning fa56067a8f
  8. maflcko force-pushed on Oct 30, 2023
  9. fanquake requested review from stickies-v on Oct 30, 2023
  10. stickies-v approved
  11. stickies-v commented at 3:33 pm on October 30, 2023: contributor
    ACK fa56067a8f56701cbda95595592e74934af7d1cd
  12. DrahtBot requested review from pablomartin4btc on Oct 30, 2023
  13. fanquake merged this on Oct 30, 2023
  14. fanquake closed this on Oct 30, 2023

  15. maflcko deleted the branch on Oct 31, 2023

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-06-29 07:13 UTC

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