Skip to content

Commit fa8adbe

Browse files
author
MarcoFalke
committed
build: Enable -Wunreachable-code
1 parent b3ab0c3 commit fa8adbe

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
@@ -446,8 +446,8 @@ if test "$CXXFLAGS_overridden" = "no"; then
446446
AX_CHECK_COMPILE_FLAG([-Wlogical-op], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wlogical-op"], [], [$CXXFLAG_WERROR])
447447
AX_CHECK_COMPILE_FLAG([-Woverloaded-virtual], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Woverloaded-virtual"], [], [$CXXFLAG_WERROR])
448448
AX_CHECK_COMPILE_FLAG([-Wsuggest-override], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wsuggest-override"], [], [$CXXFLAG_WERROR])
449-
AX_CHECK_COMPILE_FLAG([-Wunreachable-code-loop-increment], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wunreachable-code-loop-increment"], [], [$CXXFLAG_WERROR])
450449
AX_CHECK_COMPILE_FLAG([-Wimplicit-fallthrough], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wimplicit-fallthrough"], [], [$CXXFLAG_WERROR])
450+
AX_CHECK_COMPILE_FLAG([-Wunreachable-code], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wunreachable-code"], [], [$CXXFLAG_WERROR])
451451

452452
if test "$suppress_external_warnings" != "no" ; then
453453
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
@@ -1499,17 +1499,19 @@ std::unique_ptr<WalletDatabase> MakeDatabase(const fs::path& path, const Databas
14991499
if (format == DatabaseFormat::SQLITE) {
15001500
#ifdef USE_SQLITE
15011501
return MakeSQLiteDatabase(path, options, status, error);
1502-
#endif
1502+
#else
15031503
error = Untranslated(strprintf("Failed to open database path '%s'. Build does not support SQLite database format.", fs::PathToString(path)));
15041504
status = DatabaseStatus::FAILED_BAD_FORMAT;
15051505
return nullptr;
1506+
#endif
15061507
}
15071508

15081509
#ifdef USE_BDB
15091510
return MakeBerkeleyDatabase(path, options, status, error);
1510-
#endif
1511+
#else
15111512
error = Untranslated(strprintf("Failed to open database path '%s'. Build does not support Berkeley DB database format.", fs::PathToString(path)));
15121513
status = DatabaseStatus::FAILED_BAD_FORMAT;
15131514
return nullptr;
1515+
#endif
15141516
}
15151517
} // namespace wallet

0 commit comments

Comments
 (0)