build: add -W[leading|trailing]-whitespace #32482

pull fanquake wants to merge 3 commits into bitcoin:master from fanquake:trailing_whitespace changing 3 files +611 −610
  1. fanquake commented at 3:13 pm on May 13, 2025: member

    GCC 15 now has options to turn these into compile failures: https://gcc.gnu.org/gcc-15/changes.html#c-family. Fix the few cases of leading tabs, and trailing whitespace, and then enable these options. Unfortunately, CMake/Qt will generate code that contains trailing whitespace:

    0[ 98%] Building CXX object src/qt/CMakeFiles/bitcoinqt.dir/bitcoinqt_autogen/EJRQKI7XPS/qrc_bitcoin_locale.cpp.o
    1/root/bitcoin/build/src/qt/bitcoinqt_autogen/EWIEGA46WW/qrc_bitcoin.cpp:5603:2: warning: trailing whitespace [-Wtrailing-whitespace=]
    2 5603 | 
    3/root/bitcoin/build/src/qt/bitcoinqt_autogen/EWIEGA46WW/qrc_bitcoin.cpp:8254:2: warning: trailing whitespace [-Wtrailing-whitespace=]
    4 8254 | 
    5/root/bitcoin/build/src/qt/bitcoinqt_autogen/EWIEGA46WW/qrc_bitcoin.cpp:9840:2: warning: trailing whitespace [-Wtrailing-whitespace=]
    

    Will need to resolve that somehow.

  2. DrahtBot commented at 3:13 pm on May 13, 2025: contributor

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

    Code Coverage & Benchmarks

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

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Concept ACK hebasto

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

    LLM Linter (✨ experimental)

    Possible typos and grammar issues:

    • psrlq XTMP2, 17 ; XTMP2 = W[-2] ror 17 {xBxA} -> psrlq XTMP2, 17 ; XTMP2 = W[-2] » 17 {xBxA} [Comment describes a shift instruction (psrlq) as a rotate (ror), which is incorrect.]
    • psrlq XTMP3, 19 ; XTMP3 = W[-2] ror 19 {xBxA} -> psrlq XTMP3, 19 ; XTMP3 = W[-2] » 19 {xBxA} [Comment describes a shift instruction (psrlq) as a rotate (ror), which is incorrect.]
    • psrlq XTMP2, 17 ; XTMP2 = W[-2] ror 17 {xDxC} -> psrlq XTMP2, 17 ; XTMP2 = W[-2] » 17 {xDxC} [Comment describes a shift instruction (psrlq) as a rotate (ror), which is incorrect.]
    • psrlq XTMP3, 19 ; XTMP3 = W[-2] ror 19 {xDxC} -> psrlq XTMP3, 19 ; XTMP3 = W[-2] » 19 {xDxC} [Comment describes a shift instruction (psrlq) as a rotate (ror), which is incorrect.]
  3. DrahtBot added the label Build system on May 13, 2025
  4. hebasto commented at 3:19 pm on May 13, 2025: member

    GCC 15 now has options to turn these into compile failures: https://gcc.gnu.org/gcc-15/changes.html#c-family. Fix the few cases of leading tabs, and trailing whitespace, and then enable these options.

    Concept ACK on that.

    Unfortunately, CMake/Qt will generate code that contains trailing whitespace:

    0[ 98%] Building CXX object src/qt/CMakeFiles/bitcoinqt.dir/bitcoinqt_autogen/EJRQKI7XPS/qrc_bitcoin_locale.cpp.o
    1/root/bitcoin/build/src/qt/bitcoinqt_autogen/EWIEGA46WW/qrc_bitcoin.cpp:5603:2: warning: trailing whitespace [-Wtrailing-whitespace=]
    2 5603 | 
    3/root/bitcoin/build/src/qt/bitcoinqt_autogen/EWIEGA46WW/qrc_bitcoin.cpp:8254:2: warning: trailing whitespace [-Wtrailing-whitespace=]
    4 8254 | 
    5/root/bitcoin/build/src/qt/bitcoinqt_autogen/EWIEGA46WW/qrc_bitcoin.cpp:9840:2: warning: trailing whitespace [-Wtrailing-whitespace=]
    

    Will need to resolve that somehow.

    I’ll look into it.

  5. fanquake referenced this in commit c521192d8b on May 16, 2025
  6. univalue: change leading whitespace to spaces 887a837aa8
  7. crypto: remove leading/trailing whitespace in sha256_sse4.cpp a02b22919b
  8. build: add -W*-whitespace
    These are both available in GCC 15. See
    https://gcc.gnu.org/gcc-15/changes.html.
    d09af540e7
  9. fanquake force-pushed on May 16, 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-05-29 12:13 UTC

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