Skip to content

Clang 14 emits -Wunreachable-code warnings #29334

@hebasto

Description

@hebasto
% clang --version
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: x86_64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
...
CXX      wallet/libbitcoin_wallet_a-walletdb.o
wallet/walletdb.cpp:1518:15: warning: code will never be executed [-Wunreachable-code]
        error = Untranslated(strprintf("Failed to open database path '%s'. Build does not support Berkeley DB database format.", fs::PathToString(path)));
              ^
wallet/walletdb.cpp:1513:19: note: silence by adding parentheses to mark code as explicitly dead
    if constexpr (true) {
                  ^
                  /* DISABLES CODE */ ( )
wallet/walletdb.cpp:1506:19: warning: code will never be executed [-Wunreachable-code]
            error = Untranslated(strprintf("Failed to open database path '%s'. Build does not support SQLite database format.", fs::PathToString(path)));
                  ^
wallet/walletdb.cpp:1501:23: note: silence by adding parentheses to mark code as explicitly dead
        if constexpr (true) {
                      ^
                      /* DISABLES CODE */ ( )
2 warnings generated.
...

Seems related to #29315.

Not happening with Clang 15 in the macOS CI job.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions