Skip to content

Replace KD_UNUSED macro with [[maybe_unused]] attribute#107

Draft
Copilot wants to merge 3 commits intowip_fix_macosfrom
copilot/sub-pr-106
Draft

Replace KD_UNUSED macro with [[maybe_unused]] attribute#107
Copilot wants to merge 3 commits intowip_fix_macosfrom
copilot/sub-pr-106

Conversation

Copy link

Copilot AI commented Dec 17, 2025

Replace custom KD_UNUSED macro with C++17 standard [[maybe_unused]] attribute to align with existing codebase style in mosquitto_wrapper.h.

Changes

  • Function parameters: Applied [[maybe_unused]] directly to parameter declarations in function signatures

    • window.cpp: Event handlers (mouse/keyboard events)
    • linux_xcb_platform_integration.cpp: dumpScreenInfo()
  • Local variables: Moved attribute to variable declaration instead of separate statement

    • linux_xcb_platform_event_loop.cpp: Event pointers in XCB event handlers

Example

// Before
void Window::keyPressEvent(KeyPressEvent *ev)
{
    KD_UNUSED(ev); // for release builds, debug log isn't compiled in
    SPDLOG_LOGGER_DEBUG(m_logger, "{}() key = {}", __FUNCTION__, ev->key());
}

// After
void Window::keyPressEvent([[maybe_unused]] KeyPressEvent *ev)
{
    SPDLOG_LOGGER_DEBUG(m_logger, "{}() key = {}", __FUNCTION__, ev->key());
}

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits December 17, 2025 07:31
Co-authored-by: MiKom <104767+MiKom@users.noreply.github.com>
Co-authored-by: MiKom <104767+MiKom@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix unused returned value warning by using std::ignore Replace KD_UNUSED macro with [[maybe_unused]] attribute Dec 17, 2025
Copilot AI requested a review from MiKom December 17, 2025 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants