-Wleading-whitespace
and -Wtrailing-whitespace
.
-Wleading-whitespace
#32482
-Wleading-whitespace
and -Wtrailing-whitespace
.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32482.
See the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
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.
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.
-Wtrailing-whitespace
for now. That could be added when Qts tools are fixed.
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.
CMake 3.27 and newer handle this. The CMP0151
policy must be set to NEW
.
ACK 5e2620443d13b58efb38310263d67e2b823d6a1e.
The first two commits were reviewed using git diff --ignore-space-change
. Commit f2385191520f35fdef07743e5a12feaa87085dbe additionally removes an empty line, which is OK.
So
-Wtrailing-whitespace
could be enabled later, once Qts tooling is fixed.CMake 3.27 and newer handle this. The
CMP0151
policy must be set toNEW
.
As it is reasonable to expect CMake ≥3.27 on systems with GCC 15, I believe -Wtrailing-whitespace
can be reintroduced.
This is available in GCC 15. See
https://gcc.gnu.org/gcc-15/changes.html.
This is available in GCC 15. See
https://gcc.gnu.org/gcc-15/changes.html.
1028 ; addm [mem], reg
1029 ; Add reg to mem using reg-mem add and store
1030 %macro addm 2
1031- add %2, %1
1032- mov %1, %2
1033+ add %2, %1
968@@ -969,27 +969,27 @@ void Transform(uint32_t* s, const unsigned char* chunk, size_t blocks)
969
970 /*
971 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
972-; Copyright (c) 2012, Intel Corporation
973-;
974-; All rights reserved.
975-;
976+; Copyright (c) 2012, Intel Corporation
See: https://github.com/arun11299/cpp-subprocess/pull/121.