build: add -Wleading-whitespace #32482

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

    GCC 15 now has options to turn leading & trailing whitespace 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 -Wleading-whitespace. 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=]
    

    So -Wtrailing-whitespace could be enabled later, once Qts tooling is fixed.

  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.

  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. fanquake force-pushed on May 16, 2025
  7. hebasto commented at 4:36 pm on May 30, 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.

    Addressed in #32648.

  8. univalue: change leading whitespace to spaces b2d20514ca
  9. crypto: remove leading/trailing whitespace in sha256_sse4.cpp e9fa092a2f
  10. build: add -Wleading-whitespace
    This is available in GCC 15. See
    https://gcc.gnu.org/gcc-15/changes.html.
    93087de15f
  11. fanquake force-pushed on Jul 2, 2025
  12. fanquake renamed this:
    build: add `-W[leading|trailing]-whitespace`
    build: add `-Wleading-whitespace`
    on Jul 2, 2025
  13. fanquake marked this as ready for review on Jul 2, 2025
  14. fanquake commented at 1:08 pm on July 2, 2025: member
    Dropped -Wtrailing-whitespace for now. That could be added when Qts tools are fixed.

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-08-01 09:13 UTC

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