Skip to content

Commit 0cf83d9

Browse files
[libc] fix -Wmissing-braces
Fixes the following errors observed on the aarch64 fullbuild: /home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/__support/HashTable/generic/bitmask_impl.inc:116:13: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces] return {static_cast<bitmask_t>(mask_available().word ^ repeat_byte(0x80))}; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { } In file included from /home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/search/hdestroy.cpp:10: /home/libc-buildbot/libc-aarch64-ubuntu/libc-aarch64-ubuntu-fullbuild-dbg/llvm-project/libc/src/__support/HashTable/table.h:336:41: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces] iterator end() const { return {0, 0, {0}, *this}; } ^ {} Link: https://lab.llvm.org/buildbot/#/builders/223/builds/33868/steps/6/logs/stdio Link: #74506
1 parent c52b467 commit 0cf83d9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

libc/src/__support/HashTable/generic/bitmask_impl.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ struct Group {
113113
}
114114

115115
LIBC_INLINE IteratableBitMask occupied() const {
116-
return {static_cast<bitmask_t>(mask_available().word ^ repeat_byte(0x80))};
116+
return {{static_cast<bitmask_t>(mask_available().word ^ repeat_byte(0x80))}};
117117
}
118118
};
119119
} // namespace internal

libc/src/__support/HashTable/table.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ struct HashTable {
333333
return {0, full_capacity() - available_slots,
334334
Group::load_aligned(&control(0)).occupied(), *this};
335335
}
336-
iterator end() const { return {0, 0, {0}, *this}; }
336+
iterator end() const { return {0, 0, {{0}}, *this}; }
337337

338338
LIBC_INLINE ENTRY *find(const char *key) {
339339
uint64_t primary = oneshot_hash(key);

0 commit comments

Comments
 (0)