Skip to content

Commit 53dac67

Browse files
committed
Merge #19719: build: Add Werror=range-loop-analysis
fa55c1d build: Add Werror=range-loop-analysis (MarcoFalke) Pull request description: The warning is implicitly enabled for Bitcoin Core. Also explicitly since commit d92204c. To avoid "fix range loop" follow-up refactors, we have two options: * Disable the warning, so that issues never appear * Enable it as an error, so that issues are either caught locally or by ci ACKs for top commit: fanquake: ACK fa55c1d practicalswift: ACK fa55c1d -- pre-review fix-up is better than post-review fix-up hebasto: re-ACK fa55c1d Tree-SHA512: 019aa133f254af8882c1d5d10c420d9882305db0fc2aa9dad7d285168e2556306c3eedcc03bd30e63f11eae4cc82b648d83fb6e9179d6a6364651fb602d70134
2 parents 1bc8e8e + fa55c1d commit 53dac67

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ if test "x$enable_werror" = "xyes"; then
377377
AX_CHECK_COMPILE_FLAG([-Werror=shadow-field],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=shadow-field"],,[[$CXXFLAG_WERROR]])
378378
AX_CHECK_COMPILE_FLAG([-Werror=switch],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=switch"],,[[$CXXFLAG_WERROR]])
379379
AX_CHECK_COMPILE_FLAG([-Werror=thread-safety],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=thread-safety"],,[[$CXXFLAG_WERROR]])
380+
AX_CHECK_COMPILE_FLAG([-Werror=range-loop-analysis],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=range-loop-analysis"],,[[$CXXFLAG_WERROR]])
380381
AX_CHECK_COMPILE_FLAG([-Werror=unused-variable],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=unused-variable"],,[[$CXXFLAG_WERROR]])
381382
AX_CHECK_COMPILE_FLAG([-Werror=date-time],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=date-time"],,[[$CXXFLAG_WERROR]])
382383
AX_CHECK_COMPILE_FLAG([-Werror=return-type],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=return-type"],,[[$CXXFLAG_WERROR]])

src/wallet/wallettool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ bool ExecuteWalletToolFunc(const std::string& command, const std::string& name)
130130
std::vector<bilingual_str> warnings;
131131
bool ret = RecoverDatabaseFile(path, error, warnings);
132132
if (!ret) {
133-
for (const auto warning : warnings) {
133+
for (const auto& warning : warnings) {
134134
tfm::format(std::cerr, "%s\n", warning.original);
135135
}
136136
if (!error.empty()) {

0 commit comments

Comments
 (0)