Skip to content

fix(hid-rp): bump hid-rp submodule to pick up missing <bit> include - #843

Merged
finger563 merged 1 commit into
esp-cpp:mainfrom
owenpkent:fix/hid-rp-missing-bit-include
Oct 11, 2026
Merged

finger563 merged 1 commit into
esp-cpp:mainfrom
owenpkent:fix/hid-rp-missing-bit-include

Conversation

@owenpkent

Copy link
Copy Markdown
Contributor

Description

Bumps the components/hid-rp/detail/hid-rp submodule from d64ec1d to 42d8953 ("add missing headers"). That is the only upstream commit between the two. It adds #include <bit> to hid/rdf/short_item.hpp and a missing include to sized_unsigned.hpp, and changes nothing else.

Motivation and Context

hid/rdf/short_item.hpp uses std::bit_cast without including <bit>. GCC pulls <bit> in transitively, so the ESP-IDF builds are fine, but clang with the MSVC STL does not, and the header fails with no member named 'bit_cast' in namespace 'std'. We hit this building hid-rp code on a Windows host and worked around it by including <bit> first.

How has this been tested?

clang 22.1.8 (x86_64-pc-windows-msvc, MSVC STL) on Windows 11:

  • Compiled each of the 20 hid-rp headers standalone with -std=c++20 and the component's include paths. At d64ec1d 12 of 20 fail; at 42d8953 all 20 compile.
  • Built and ran the hid-rp host tests in components/hid-rp/test with the commands in their header comments (-Wall -Wextra -Werror). hid_rp_3dconnexion_host_test, hid_rp_gamepad_host_test and hid_rp_report_map_host_test pass at the new pin.

Two things showed up that are not caused by this change (identical at both pins), noted here in case they are useful:

  • hid-rp-switch-pro.hpp uses auto(x) in a concept, which is C++23. GCC accepts it in C++20 mode, clang rejects it, so hid_rp_report_map_host_test and hid_rp_reports_host_test only compile on clang with -std=c++23.
  • With -std=c++23, hid_rp_reports_host_test hits static_assert(num_data_bytes == 9) for PlaystationDualsenseBLESimpleInputReport under the MSVC ABI.

I did not run idf.py build; the submodule change only adds two includes.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Hardware (schematic, board, system design) change
  • Software change

Checklist:

  • My change requires a change to the documentation.
  • I have added / updated the documentation related to this change via either README or WIKI

Software

  • I have added tests to cover my changes.
  • I have updated the .github/workflows/build.yml file to add my new test to the automated cloud build github action.
  • All new and existing tests passed. (Not checked: see the two existing clang/MSVC failures above, which are unrelated to this change.)
  • My code follows the code style of this project.

hid/rdf/short_item.hpp uses std::bit_cast without including <bit>.
GCC pulls it in transitively, but clang with the MSVC STL does not, so
the header fails to compile there. Upstream fixed this in 42d8953
("add missing headers"), which also adds a missing include to
sized_unsigned.hpp. That is the only commit between the old pin
(d64ec1d) and the new one, so there are no other changes.
Copilot AI balanced review requested due to automatic review settings October 11, 2026 19:44
@github-actions

Copy link
Copy Markdown

✅Static analysis result - no issues found! ✅

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The narrowly scoped dependency update matches the described upstream commit and fixes the missing includes without other code changes.

0 open findings

What changed in this PR

Updates the bundled hid-rp dependency to fix standalone C++20 header compilation.

Changes:

  • Bumps hid-rp from d64ec1d to 42d8953.
  • Adds required upstream <bit> and <limits> includes.
File Description
components/​hid-rp/​detail/​hid-rp Updates the submodule revision containing the header fixes.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@finger563
finger563 merged commit efc0791 into esp-cpp:main Oct 11, 2026
1 check passed
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.

3 participants