[PR #1232] [MERGED] Fix compilation warnings for missing field initializers #2090

Closed
opened 2026-10-29 21:32:43 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/kvcache-ai/Mooncake/pull/1232
Author: @Copilot
Created: 12/18/2025
Status: ✅ Merged
Merged: 12/18/2025
Merged by: @stmatengss

Base: main ← Head: copilot/fix-compilation-warnings


📝 Commits (8)

  • 2680e1c Initial plan
  • 70d942d Fix compilation warnings for visibility and missing initializers
  • 9ba33db Complete fix for compilation warnings
  • a36062c Remove build artifacts and update .gitignore
  • 250290b Use pragma GCC diagnostic to suppress visibility warnings instead of attributes
  • e3bb5a8 Narrow scope of pragma diagnostic directives for lambda
  • 23c0269 fix
  • d340010 Revert all changes in mooncake-transfer-engine directory

📊 Changes

3 files changed (+6 additions, -3 deletions)

View changed files

📝 .gitignore (+3 -0)
📝 mooncake-store/src/storage_backend.cpp (+2 -2)
📝 mooncake-store/tests/pybind_client_test.cpp (+1 -1)

📄 Description

Description

Resolves compilation warnings from -Wmissing-field-initializers in mooncake-store.

Missing field initializers

StorageObjectMetadata aggregate initialization omitted the transport_endpoint field:

  • Added empty string initialization for transport_endpoint in BatchOffload and ScanMeta methods in storage_backend.cpp

Example fix:

// Before
StorageObjectMetadata{-1, 0, key_size, data_size}

// After  
StorageObjectMetadata{-1, 0, key_size, data_size, ""}

Note: Visibility attribute warnings in mooncake-transfer-engine remain unaddressed. All changes to that module have been reverted per maintainer request.

Type of Change

  • Types
    • Bug fix
    • New feature
      • Transfer Engine
      • Mooncake Store
      • Mooncake EP
      • Integration
      • P2P Store
      • Python Wheel
    • Breaking change
    • CI/CD
    • Documentation update
    • Other

How Has This Been Tested?

Code review and security scan completed successfully. No behavior changes—only proper struct initialization to fix missing field initializer warnings.

Checklist

  • I have performed a self-review of my own code.
  • I have updated the documentation.
  • I have added tests to prove my changes are effective.
Original prompt

This section details on the original issue you should resolve

<issue_title>[Bug]: Compilation produced several warnings.</issue_title>
<issue_description>### Bug Report

In file included from /root/mateng/Mooncake/mooncake-transfer-engine/src/transport/rpc_communicator/rpc_interface.cpp:2:
/root/mateng/Mooncake/mooncake-transfer-engine/include/transport/rpc_communicator/rpc_communicator.h:32:7: warning: ‘mooncake::RpcCommunicator’ declared with greater visibility than the type of its field ‘mooncake::RpcCommunicator::py_callback_’ [-Wattributes]
   32 | class RpcCommunicator {
      |       ^~~~~~~~~~~~~~~
/root/mateng/Mooncake/mooncake-transfer-engine/src/transport/rpc_communicator/rpc_interface.cpp:19:21: warning: ‘mooncake::RpcInterface::Impl’ declared with greater visibility than the type of its field ‘mooncake::RpcInterface::Impl::data_receive_callback’ [-Wattributes]
   19 | class RpcInterface::Impl {
      |                     ^~~~
/root/mateng/Mooncake/mooncake-transfer-engine/src/transport/rpc_communicator/rpc_interface.cpp:19:21: warning: ‘mooncake::RpcInterface::Impl’ declared with greater visibility than the type of its field ‘mooncake::RpcInterface::Impl::tensor_receive_callback’ [-Wattributes]
In file included from /root/mateng/Mooncake/mooncake-transfer-engine/src/transport/rpc_communicator/rpc_communicator.cpp:1:
/root/mateng/Mooncake/mooncake-transfer-engine/include/transport/rpc_communicator/rpc_communicator.h:32:7: warning: ‘mooncake::RpcCommunicator’ declared with greater visibility than the type of its field ‘mooncake::RpcCommunicator::py_callback_’ [-Wattributes]
   32 | class RpcCommunicator {
      |       ^~~~~~~~~~~~~~~
[ 12%] Built target rdma_transport
/root/mateng/Mooncake/mooncake-transfer-engine/src/transport/rpc_communicator/rpc_communicator.cpp: In member function ‘void mooncake::py_rpc_context::response_msg(pybind11::buffer, pybind11::object)’:
/root/mateng/Mooncake/mooncake-transfer-engine/src/transport/rpc_communicator/rpc_communicator.cpp:26:18: warning: ‘mooncake::py_rpc_context::response_msg(pybind11::buffer, pybind11::object)::<lambda(const std::error_code&, std::size_t)>’ declared with greater visibility than the type of its field ‘mooncake::py_rpc_context::response_msg(pybind11::buffer, pybind11::object)::<lambda(const std::error_code&, std::size_t)>::<done capture>’ [-Wattributes]
   26 |             [done](const std::error_code& ec, std::size_t) {
      |    
/root/mateng/Mooncake/mooncake-store/src/storage_backend.cpp: In member function ‘virtual tl::expected<long int, mooncake::ErrorCode> mooncake::StorageBackendAdaptor::BatchOffload(const std::unordered_map<std::__cxx11::basic_string<char>, std::vector<mooncake::Slice> >&, std::function<mooncake::ErrorCode(const std::vector<std::__cxx11::basic_string<char> >&, std::vector<mooncake::StorageObjectMetadata>&)>)’:
/root/mateng/Mooncake/mooncake-store/src/storage_backend.cpp:1035:72: warning: missing initializer for member ‘mooncake::StorageObjectMetadata::transport_endpoint’ [-Wmissing-field-initializers]
 1035 |                                   static_cast<int64_t>(kv.value.size())});
      |                                                                        ^
/root/mateng/Mooncake/mooncake-store/src/storage_backend.cpp: In member function ‘virtual tl::expected<void, mooncake::ErrorCode> mooncake::StorageBackendAdaptor::ScanMeta(const std::function<mooncake::ErrorCode(const std::vector<std::__cxx11::basic_string<char> >&, std::vector<mooncake::StorageObjectMetadata>&)>&)’:
/root/mateng/Mooncake/mooncake-store/src/storage_backend.cpp:1171:58: warning: missing initializer for member ‘mooncake::StorageObjectMetadata::transport_endpoint’ [-Wmissing-field-initializers]
 1171 |                     static_cast<int64_t>(kv.value.size())});

Before submitting...

  • Ensure you searched for relevant issues and read the [documentation]</issue_description>

<agent_instructions>Fix these warnings in compilation</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/kvcache-ai/Mooncake/pull/1232 **Author:** [@Copilot](https://github.com/apps/copilot-swe-agent) **Created:** 12/18/2025 **Status:** ✅ Merged **Merged:** 12/18/2025 **Merged by:** [@stmatengss](https://github.com/stmatengss) **Base:** `main` ← **Head:** `copilot/fix-compilation-warnings` --- ### 📝 Commits (8) - [`2680e1c`](https://github.com/kvcache-ai/Mooncake/commit/2680e1c496cc6c98bf46baa66e0c8bb01f897fb1) Initial plan - [`70d942d`](https://github.com/kvcache-ai/Mooncake/commit/70d942d1193f19e76a49e34b4b3e2bd1202c78e4) Fix compilation warnings for visibility and missing initializers - [`9ba33db`](https://github.com/kvcache-ai/Mooncake/commit/9ba33db3a132b10254edd289789669d8039af284) Complete fix for compilation warnings - [`a36062c`](https://github.com/kvcache-ai/Mooncake/commit/a36062c06d1568389dde99dbe350919d484e3bb4) Remove build artifacts and update .gitignore - [`250290b`](https://github.com/kvcache-ai/Mooncake/commit/250290bb6f5b3c18c00abf10e5c3c666616d535b) Use pragma GCC diagnostic to suppress visibility warnings instead of attributes - [`e3bb5a8`](https://github.com/kvcache-ai/Mooncake/commit/e3bb5a8e7cce658fd3863464438e583b6719e1bf) Narrow scope of pragma diagnostic directives for lambda - [`23c0269`](https://github.com/kvcache-ai/Mooncake/commit/23c0269f10ff1167ce4d1bcd6391f21a9781eeb2) fix - [`d340010`](https://github.com/kvcache-ai/Mooncake/commit/d3400102c97065ddbbd4a7141976a20e099e87a3) Revert all changes in mooncake-transfer-engine directory ### 📊 Changes **3 files changed** (+6 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+3 -0) 📝 `mooncake-store/src/storage_backend.cpp` (+2 -2) 📝 `mooncake-store/tests/pybind_client_test.cpp` (+1 -1) </details> ### 📄 Description ## Description Resolves compilation warnings from `-Wmissing-field-initializers` in mooncake-store. ### Missing field initializers `StorageObjectMetadata` aggregate initialization omitted the `transport_endpoint` field: - Added empty string initialization for `transport_endpoint` in `BatchOffload` and `ScanMeta` methods in `storage_backend.cpp` Example fix: ```cpp // Before StorageObjectMetadata{-1, 0, key_size, data_size} // After StorageObjectMetadata{-1, 0, key_size, data_size, ""} ``` **Note**: Visibility attribute warnings in mooncake-transfer-engine remain unaddressed. All changes to that module have been reverted per maintainer request. ## Type of Change * Types - [x] Bug fix - [ ] New feature - [ ] Transfer Engine - [ ] Mooncake Store - [ ] Mooncake EP - [ ] Integration - [ ] P2P Store - [ ] Python Wheel - [ ] Breaking change - [ ] CI/CD - [ ] Documentation update - [ ] Other ## How Has This Been Tested? Code review and security scan completed successfully. No behavior changes—only proper struct initialization to fix missing field initializer warnings. ## Checklist - [x] I have performed a self-review of my own code. - [x] I have updated the documentation. - [ ] I have added tests to prove my changes are effective. <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>[Bug]: Compilation produced several warnings.</issue_title> > <issue_description>### Bug Report > > ``` > In file included from /root/mateng/Mooncake/mooncake-transfer-engine/src/transport/rpc_communicator/rpc_interface.cpp:2: > /root/mateng/Mooncake/mooncake-transfer-engine/include/transport/rpc_communicator/rpc_communicator.h:32:7: warning: ‘mooncake::RpcCommunicator’ declared with greater visibility than the type of its field ‘mooncake::RpcCommunicator::py_callback_’ [-Wattributes] > 32 | class RpcCommunicator { > | ^~~~~~~~~~~~~~~ > /root/mateng/Mooncake/mooncake-transfer-engine/src/transport/rpc_communicator/rpc_interface.cpp:19:21: warning: ‘mooncake::RpcInterface::Impl’ declared with greater visibility than the type of its field ‘mooncake::RpcInterface::Impl::data_receive_callback’ [-Wattributes] > 19 | class RpcInterface::Impl { > | ^~~~ > /root/mateng/Mooncake/mooncake-transfer-engine/src/transport/rpc_communicator/rpc_interface.cpp:19:21: warning: ‘mooncake::RpcInterface::Impl’ declared with greater visibility than the type of its field ‘mooncake::RpcInterface::Impl::tensor_receive_callback’ [-Wattributes] > In file included from /root/mateng/Mooncake/mooncake-transfer-engine/src/transport/rpc_communicator/rpc_communicator.cpp:1: > /root/mateng/Mooncake/mooncake-transfer-engine/include/transport/rpc_communicator/rpc_communicator.h:32:7: warning: ‘mooncake::RpcCommunicator’ declared with greater visibility than the type of its field ‘mooncake::RpcCommunicator::py_callback_’ [-Wattributes] > 32 | class RpcCommunicator { > | ^~~~~~~~~~~~~~~ > [ 12%] Built target rdma_transport > /root/mateng/Mooncake/mooncake-transfer-engine/src/transport/rpc_communicator/rpc_communicator.cpp: In member function ‘void mooncake::py_rpc_context::response_msg(pybind11::buffer, pybind11::object)’: > /root/mateng/Mooncake/mooncake-transfer-engine/src/transport/rpc_communicator/rpc_communicator.cpp:26:18: warning: ‘mooncake::py_rpc_context::response_msg(pybind11::buffer, pybind11::object)::<lambda(const std::error_code&, std::size_t)>’ declared with greater visibility than the type of its field ‘mooncake::py_rpc_context::response_msg(pybind11::buffer, pybind11::object)::<lambda(const std::error_code&, std::size_t)>::<done capture>’ [-Wattributes] > 26 | [done](const std::error_code& ec, std::size_t) { > | > ``` > > ``` > /root/mateng/Mooncake/mooncake-store/src/storage_backend.cpp: In member function ‘virtual tl::expected<long int, mooncake::ErrorCode> mooncake::StorageBackendAdaptor::BatchOffload(const std::unordered_map<std::__cxx11::basic_string<char>, std::vector<mooncake::Slice> >&, std::function<mooncake::ErrorCode(const std::vector<std::__cxx11::basic_string<char> >&, std::vector<mooncake::StorageObjectMetadata>&)>)’: > /root/mateng/Mooncake/mooncake-store/src/storage_backend.cpp:1035:72: warning: missing initializer for member ‘mooncake::StorageObjectMetadata::transport_endpoint’ [-Wmissing-field-initializers] > 1035 | static_cast<int64_t>(kv.value.size())}); > | ^ > /root/mateng/Mooncake/mooncake-store/src/storage_backend.cpp: In member function ‘virtual tl::expected<void, mooncake::ErrorCode> mooncake::StorageBackendAdaptor::ScanMeta(const std::function<mooncake::ErrorCode(const std::vector<std::__cxx11::basic_string<char> >&, std::vector<mooncake::StorageObjectMetadata>&)>&)’: > /root/mateng/Mooncake/mooncake-store/src/storage_backend.cpp:1171:58: warning: missing initializer for member ‘mooncake::StorageObjectMetadata::transport_endpoint’ [-Wmissing-field-initializers] > 1171 | static_cast<int64_t>(kv.value.size())}); > ``` > > ### Before submitting... > > - [ ] Ensure you searched for relevant issues and read the [documentation]</issue_description> > > <agent_instructions>Fix these warnings in compilation</agent_instructions> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> <!-- START COPILOT CODING AGENT SUFFIX --> - Fixes kvcache-ai/Mooncake#1231 <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/kvcache-ai/Mooncake/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 21:32:43 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/Mooncake#2090
No description provided.