cmake: Disable `-Wtrailing-whitespace` warnings for RCC-generated files
What changed, and why it matters
This change simply tells the compiler to ignore a harmless style warning about extra spaces at the end of lines in files automatically generated by Qt's resource compiler. It does not fix a security bug or change any program behavior.
No security action needed. This is a benign build-system warning suppression.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit disables the -Wtrailing-whitespace=any warning for RCC-generated source files (BITCOIN_QRC, BITCOIN_LOCALE_QRC) in src/qt/CMakeLists.txt. The warning is triggered by a known Qt bug (QTBUG-141858) where generated files contain trailing whitespace. The patch only adjusts compiler warning flags for generated files and has no functional or security impact.
Changed components
src/qt/CMakeLists.txtInspect captured patch +6 / −0
diff --git a/src/qt/CMakeLists.txt b/src/qt/CMakeLists.txt
index 2f66fb3c..58fa08b5 100644
--- a/src/qt/CMakeLists.txt
+++ b/src/qt/CMakeLists.txt
@@ -57,6 +57,12 @@ set(CMAKE_AUTORCC OFF)
configure_file(bitcoin_locale.qrc bitcoin_locale.qrc USE_SOURCE_PERMISSIONS COPYONLY)
qt6_add_resources(BITCOIN_QRC bitcoin.qrc)
qt6_add_resources(BITCOIN_LOCALE_QRC ${CMAKE_CURRENT_BINARY_DIR}/bitcoin_locale.qrc)
+# See: https://bugreports.qt.io/browse/QTBUG-141858.
+get_target_property(warn_flags warn_interface INTERFACE_COMPILE_OPTIONS)
+if("-Wtrailing-whitespace=any" IN_LIST warn_flags)
+ set_source_files_properties(${BITCOIN_QRC} ${BITCOIN_LOCALE_QRC} PROPERTIES COMPILE_OPTIONS -Wno-trailing-whitespace)
+endif()
+unset(warn_flags)
# The bitcoinqt sources have to include headers in
# order to parse them to collect translatable strings.
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.