Skip to content

Commit 7100780

Browse files
committed
merge bitcoin#28999: Enable -Wunreachable-code
1 parent 5471c58 commit 7100780

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,8 +477,8 @@ if test "$CXXFLAGS_overridden" = "no"; then
477477
AX_CHECK_COMPILE_FLAG([-Wlogical-op], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wlogical-op"], [], [$CXXFLAG_WERROR])
478478
AX_CHECK_COMPILE_FLAG([-Woverloaded-virtual], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Woverloaded-virtual"], [], [$CXXFLAG_WERROR])
479479
AX_CHECK_COMPILE_FLAG([-Wsuggest-override], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wsuggest-override"], [], [$CXXFLAG_WERROR])
480-
AX_CHECK_COMPILE_FLAG([-Wunreachable-code-loop-increment], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wunreachable-code-loop-increment"], [], [$CXXFLAG_WERROR])
481480
AX_CHECK_COMPILE_FLAG([-Wimplicit-fallthrough], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wimplicit-fallthrough"], [], [$CXXFLAG_WERROR])
481+
AX_CHECK_COMPILE_FLAG([-Wunreachable-code], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wunreachable-code"], [], [$CXXFLAG_WERROR])
482482

483483
if test "$suppress_external_warnings" != "no" ; then
484484
AX_CHECK_COMPILE_FLAG([-Wdocumentation], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wdocumentation"], [], [$CXXFLAG_WERROR])

src/wallet/walletdb.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,18 +1161,20 @@ std::unique_ptr<WalletDatabase> MakeDatabase(const fs::path& path, const Databas
11611161
if (format == DatabaseFormat::SQLITE) {
11621162
#ifdef USE_SQLITE
11631163
return MakeSQLiteDatabase(path, options, status, error);
1164-
#endif
1164+
#else
11651165
error = Untranslated(strprintf("Failed to open database path '%s'. Build does not support SQLite database format.", fs::PathToString(path)));
11661166
status = DatabaseStatus::FAILED_BAD_FORMAT;
11671167
return nullptr;
1168+
#endif
11681169
}
11691170

11701171
#ifdef USE_BDB
11711172
return MakeBerkeleyDatabase(path, options, status, error);
1172-
#endif
1173+
#else
11731174
error = Untranslated(strprintf("Failed to open database path '%s'. Build does not support Berkeley DB database format.", fs::PathToString(path)));
11741175
status = DatabaseStatus::FAILED_BAD_FORMAT;
11751176
return nullptr;
1177+
#endif
11761178
}
11771179

11781180
/** Return object for accessing dummy database with no read/write capabilities. */

0 commit comments

Comments
 (0)