win32: fix -Wmissing-field-initializers warnings#1053
Closed
fanquake wants to merge 1 commit intogoogle:mainfrom
fanquake:fix_win_overlapped_uninit
Closed
win32: fix -Wmissing-field-initializers warnings#1053fanquake wants to merge 1 commit intogoogle:mainfrom fanquake:fix_win_overlapped_uninit
fanquake wants to merge 1 commit intogoogle:mainfrom
fanquake:fix_win_overlapped_uninit
Conversation
When building with `-Wmissing-field-initializers`, the following warning
is emitted:
```bash
leveldb/util/env_windows.cc: In member function ‘virtual leveldb::Status leveldb::{anonymous}::WindowsRandomAccessFile::Read(uint64_t, size_t, leveldb::Slice*, char*) const’:
leveldb/util/env_windows.cc:197:31: warning: missing initializer for member ‘_OVERLAPPED::InternalHigh’ [-Wmissing-field-initializers]
197 | OVERLAPPED overlapped = {0};
| ^
leveldb/util/env_windows.cc:197:31: warning: missing initializer for member ‘_OVERLAPPED::<anonymous>’ [-Wmissing-field-initializers]
leveldb/util/env_windows.cc:197:31: warning: missing initializer for member ‘_OVERLAPPED::hEvent’ [-Wmissing-field-initializers]
```
This was referenced Sep 15, 2022
krishnacx
reviewed
Sep 19, 2022
krishnacx
left a comment
There was a problem hiding this comment.
Though change is correct. Any reason why we are bulding with warning option -Wmissing-field-initializers ?
fanquake
added a commit
to bitcoin-core/leveldb-subtree
that referenced
this pull request
Sep 29, 2022
12c52b3 win32: fix -Wmissing-field-initializers warnings (fanquake) Pull request description: When building with `-Wmissing-field-initializers`, the following warning is emitted: ```bash leveldb/util/env_windows.cc: In member function ‘virtual leveldb::Status leveldb::{anonymous}::WindowsRandomAccessFile::Read(uint64_t, size_t, leveldb::Slice*, char*) const’: leveldb/util/env_windows.cc:197:31: warning: missing initializer for member ‘_OVERLAPPED::InternalHigh’ [-Wmissing-field-initializers] 197 | OVERLAPPED overlapped = {0}; | ^ leveldb/util/env_windows.cc:197:31: warning: missing initializer for member ‘_OVERLAPPED::<anonymous>’ [-Wmissing-field-initializers] leveldb/util/env_windows.cc:197:31: warning: missing initializer for member ‘_OVERLAPPED::hEvent’ [-Wmissing-field-initializers] ``` Submitted upstream: google#1053 ACKs for top commit: sipsorcery: ACK 12c52b3. hebasto: ACK 12c52b3, I have reviewed the code and it looks OK. theuni: ACK 12c52b3 Tree-SHA512: be8590f37c21af2ed5e77ebd5fdf6c5da1cba1e72c46c241202b4dfbcd3667e1aa2522b303eaa9c1e5d6a61290dd268e76c0a1e42df6bf5734c775ca6b2dbdf2
krishnacx
approved these changes
Nov 1, 2022
This was referenced Apr 4, 2025
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.
When building with
-Wmissing-field-initializers, the following warning is emitted: