Fix Clang -Wconditional-uninitialized warning#59
Merged
Conversation
|
Unrelated: Google is using clang to build their projects, so I wonder why they haven't fixed it yet upstream or if they are also using a workaround 🤔
Seems fine, if the motivation is to remove build code. |
Member
Author
From the build log of the Bitcoin Core patched to enable the warning: |
Member
|
Yes the compiler warns, but Core doesn't set |
8c70878 to
0711e6d
Compare
|
lgtm ACK 0711e6d |
fanquake
added a commit
to fanquake/bitcoin
that referenced
this pull request
May 28, 2026
a7f9bdc611 Merge bitcoin-core/leveldb-subtree#52: Revert "Increase maximum read-only mmap()s used from 1000 to 4096 on 64-bit systems" a2f531d2d0 Merge bitcoin-core/leveldb-subtree#60: util: use [[fallthrough]] directly 1a166221cf Merge bitcoin-core/leveldb-subtree#61: Disable seek compaction 6bfdb6093b Disable seek compaction 42a5f29aa9 util: use [[fallthrough]] directly c274b50867 Merge bitcoin-core/leveldb-subtree#53: refactor: Delete unused `ScopedHandle:operator=(ScopedHandle&&)` 68740f586f Merge bitcoin-core/leveldb-subtree#59: Fix Clang `-Wconditional-uninitialized` warning 70142e186b Merge bitcoin-core/leveldb-subtree#55: build: Require C++17 d123cf5a83 Effectively, this change 31361bf339 Allow different C/C++ standards when this is used as a subproject. 0711e6d082 Fix Clang `-Wconditional-uninitialized` warning 85665f9547 refactor: Delete unused `ScopedHandle:operator=(ScopedHandle&&)` fd8f69657e Revert "Increase maximum read-only mmap()s used from 1000 to 4096 on 64-bit systems" git-subtree-dir: src/leveldb git-subtree-split: a7f9bdc6114fe6eeb848fda2980fe61d86ff2045
fanquake
added a commit
to bitcoin/bitcoin
that referenced
this pull request
May 28, 2026
a9ac680 build: remove FALLTHROUGH_INTENDED from leveldb.cmake (fanquake) 4d58c32 build: remove -Wno-conditional-uninitialized from leveldb build (fanquake) 58cdb5c Squashed 'src/leveldb/' changes from ab6c84e6f3..a7f9bdc611 (fanquake) Pull request description: Includes: * bitcoin-core/leveldb-subtree#52 * bitcoin-core/leveldb-subtree#53 * bitcoin-core/leveldb-subtree#55 * bitcoin-core/leveldb-subtree#59 * bitcoin-core/leveldb-subtree#60 * bitcoin-core/leveldb-subtree#61 ACKs for top commit: hebasto: ACK a9ac680. sedited: ACK a9ac680 andrewtoth: ACK a9ac680 Tree-SHA512: dc80a0e5eabd63866b395681935ba47bd3f67292049f2cce77f6bcf9cdd6f3bb9bcf2d87ae836a7af5b3f07fe21a1885697cbae3eb930900e396c2588910e12a
mraksoll4
added a commit
to Bitwebissss/bitweb-ver1
that referenced
this pull request
Jun 3, 2026
8e89537cef Merge bitcoin-core/leveldb-subtree#62: ci: Add LevelDB test workflow 47abe23ff2 ci: run LevelDB tests in GitHub Actions a7f9bdc611 Merge bitcoin-core/leveldb-subtree#52: Revert "Increase maximum read-only mmap()s used from 1000 to 4096 on 64-bit systems" a2f531d2d0 Merge bitcoin-core/leveldb-subtree#60: util: use [[fallthrough]] directly 1a166221cf Merge bitcoin-core/leveldb-subtree#61: Disable seek compaction 6bfdb6093b Disable seek compaction 42a5f29aa9 util: use [[fallthrough]] directly c274b50867 Merge bitcoin-core/leveldb-subtree#53: refactor: Delete unused `ScopedHandle:operator=(ScopedHandle&&)` 68740f586f Merge bitcoin-core/leveldb-subtree#59: Fix Clang `-Wconditional-uninitialized` warning 70142e186b Merge bitcoin-core/leveldb-subtree#55: build: Require C++17 d123cf5a83 Effectively, this change 31361bf339 Allow different C/C++ standards when this is used as a subproject. 0711e6d082 Fix Clang `-Wconditional-uninitialized` warning ab6c84e6f3 Merge bitcoin-core/leveldb-subtree#58: Initialize file_size to 0 to avoid UB ad9b1c9893 Initialize file_size to 0 to avoid UB cad64b151d Merge bitcoin-core/leveldb-subtree#57: doc: fix typos 157ed16be9 doc: fix typos 85665f9547 refactor: Delete unused `ScopedHandle:operator=(ScopedHandle&&)` fd8f69657e Revert "Increase maximum read-only mmap()s used from 1000 to 4096 on 64-bit systems" git-subtree-dir: src/leveldb git-subtree-split: 8e89537cef1144b6b75df83ac53239b79d6e2617
mraksoll4
added a commit
to bitweb-project/bitweb
that referenced
this pull request
Jun 4, 2026
8e89537cef Merge bitcoin-core/leveldb-subtree#62: ci: Add LevelDB test workflow 47abe23ff2 ci: run LevelDB tests in GitHub Actions a7f9bdc611 Merge bitcoin-core/leveldb-subtree#52: Revert "Increase maximum read-only mmap()s used from 1000 to 4096 on 64-bit systems" a2f531d2d0 Merge bitcoin-core/leveldb-subtree#60: util: use [[fallthrough]] directly 1a166221cf Merge bitcoin-core/leveldb-subtree#61: Disable seek compaction 6bfdb6093b Disable seek compaction 42a5f29aa9 util: use [[fallthrough]] directly c274b50867 Merge bitcoin-core/leveldb-subtree#53: refactor: Delete unused `ScopedHandle:operator=(ScopedHandle&&)` 68740f586f Merge bitcoin-core/leveldb-subtree#59: Fix Clang `-Wconditional-uninitialized` warning 70142e186b Merge bitcoin-core/leveldb-subtree#55: build: Require C++17 d123cf5a83 Effectively, this change 31361bf339 Allow different C/C++ standards when this is used as a subproject. 0711e6d082 Fix Clang `-Wconditional-uninitialized` warning ab6c84e6f3 Merge bitcoin-core/leveldb-subtree#58: Initialize file_size to 0 to avoid UB ad9b1c9893 Initialize file_size to 0 to avoid UB cad64b151d Merge bitcoin-core/leveldb-subtree#57: doc: fix typos 157ed16be9 doc: fix typos 85665f9547 refactor: Delete unused `ScopedHandle:operator=(ScopedHandle&&)` fd8f69657e Revert "Increase maximum read-only mmap()s used from 1000 to 4096 on 64-bit systems" git-subtree-dir: src/leveldb git-subtree-split: 8e89537cef1144b6b75df83ac53239b79d6e2617
Kino1994
pushed a commit
to Kino1994/bitcoin-full-history
that referenced
this pull request
Jun 28, 2026
0a6aeed build: remove FALLTHROUGH_INTENDED from leveldb.cmake (fanquake) 9b7550e build: remove -Wno-conditional-uninitialized from leveldb build (fanquake) 58cdb5c Squashed 'src/leveldb/' changes from ab6c84e6f3..a7f9bdc611 (fanquake) Pull request description: Includes: * bitcoin-core/leveldb-subtree#52 * bitcoin-core/leveldb-subtree#53 * bitcoin-core/leveldb-subtree#55 * bitcoin-core/leveldb-subtree#59 * bitcoin-core/leveldb-subtree#60 * bitcoin-core/leveldb-subtree#61 ACKs for top commit: hebasto: ACK 0a6aeed. sedited: ACK 0a6aeed andrewtoth: ACK 0a6aeed Tree-SHA512: dc80a0e5eabd63866b395681935ba47bd3f67292049f2cce77f6bcf9cdd6f3bb9bcf2d87ae836a7af5b3f07fe21a1885697cbae3eb930900e396c2588910e12a
BigcoinBGC
pushed a commit
to BigcoinBGC/bigcoin
that referenced
this pull request
Jun 30, 2026
b27d612 build: remove FALLTHROUGH_INTENDED from leveldb.cmake (fanquake) f2b0e14 build: remove -Wno-conditional-uninitialized from leveldb build (fanquake) 58cdb5c Squashed 'src/leveldb/' changes from ab6c84e6f3..a7f9bdc611 (fanquake) Pull request description: Includes: * bitcoin-core/leveldb-subtree#52 * bitcoin-core/leveldb-subtree#53 * bitcoin-core/leveldb-subtree#55 * bitcoin-core/leveldb-subtree#59 * bitcoin-core/leveldb-subtree#60 * bitcoin-core/leveldb-subtree#61 ACKs for top commit: hebasto: ACK b27d612. sedited: ACK b27d612 andrewtoth: ACK b27d612 Tree-SHA512: dc80a0e5eabd63866b395681935ba47bd3f67292049f2cce77f6bcf9cdd6f3bb9bcf2d87ae836a7af5b3f07fe21a1885697cbae3eb930900e396c2588910e12a
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Steps to reproduce the warning on Ubuntu 25.10 using Clang 22.0:
This eliminates the need for the following code: