Skip to content

Commit

Permalink
folly/io/async/IoUringZeroCopyBufferPool.cpp: suppress -Wmissing-desi…
Browse files Browse the repository at this point in the history
…gnated-field-initializers for iouring-related code

Summary:
This avoids the following errors, among quite a few others:

  folly/io/async/IoUringZeroCopyBufferPool.cpp:139:3: error: missing field 'id' initializer [-Werror,-Wmissing-designated-field-initializers]
  folly/io/async/IoUringZeroCopyBufferPool.cpp:145:3: error: missing field 'rq_area_token' initializer [-Werror,-Wmissing-designated-field-initializers]
  folly/io/async/IoUringZeroCopyBufferPool.cpp:153:3: error: missing field 'flags' initializer [-Werror,-Wmissing-designated-field-initializers]

The alternative would have been to add several initializations involving names like `__resv` and `__resv2`:
```
  .offsets = {.head = 0, .tail = 0, .rqes = 0, .__resv2},
  .__resv = 0,
```

Reviewed By: dmm-fb

Differential Revision: D70029686

fbshipit-source-id: 9ecfa29fc98ced4f2b5c71581f84e4a497b1b39c
  • Loading branch information
Jim Meyering authored and facebook-github-bot committed Feb 22, 2025
1 parent 8dd8df7 commit c378f90
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions folly/io/async/IoUringZeroCopyBufferPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ void IoUringZeroCopyBufferPool::mapMemory() {
rqRingArea_ = static_cast<char*>(bufArea_) + bufAreaSize_;
}

FOLLY_PUSH_WARNING
FOLLY_GNU_DISABLE_WARNING("-Wmissing-designated-field-initializers")

void IoUringZeroCopyBufferPool::initialRegister(
uint32_t ifindex, uint16_t queueId) {
mapMemory();
Expand All @@ -152,6 +155,8 @@ void IoUringZeroCopyBufferPool::initialRegister(
.region_ptr = reinterpret_cast<uint64_t>(&regionReg),
};

FOLLY_POP_WARNING

auto ret = io_uring_register_ifq(ring_, &ifqReg);
if (ret) {
::munmap(bufArea_, bufAreaSize_ + rqRingAreaSize_);
Expand Down

0 comments on commit c378f90

Please sign in to comment.