Skip to content

add missing header for gcc15#88

Open
nim65s wants to merge 2 commits intoROBOTIS-GIT:mainfrom
nim65s:gcc15
Open

add missing header for gcc15#88
nim65s wants to merge 2 commits intoROBOTIS-GIT:mainfrom
nim65s:gcc15

Conversation

@nim65s
Copy link
Copy Markdown

@nim65s nim65s commented Mar 30, 2026

fix:

[ 57%] Building CXX object CMakeFiles/ffw_robot_manager.dir/src/battery_model.cpp.o
In file included from /build/ai_worker-release-release-jazzy-ffw_robot_manager-1.1.20-1/src/battery_model.cpp:17:
/build/ai_worker-release-release-jazzy-ffw_robot_manager-1.1.20-1/include/ffw_robot_manager/battery_model.hpp:68:11: error: 'uint8_t' does not name a type
   68 |   virtual uint8_t get_power_supply_technology() const = 0;
      |           ^~~~~~~

fix:
```cpp
[ 57%] Building CXX object CMakeFiles/ffw_robot_manager.dir/src/battery_model.cpp.o
In file included from /build/ai_worker-release-release-jazzy-ffw_robot_manager-1.1.20-1/src/battery_model.cpp:17:
/build/ai_worker-release-release-jazzy-ffw_robot_manager-1.1.20-1/include/ffw_robot_manager/battery_model.hpp:68:11: error: 'uint8_t' does not name a type
   68 |   virtual uint8_t get_power_supply_technology() const = 0;
      |           ^~~~~~~
```
Copilot AI review requested due to automatic review settings March 30, 2026 23:15
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a GCC 15 build failure in ffw_robot_manager by ensuring the standard integer type uint8_t is available in the public battery model interface header.

Changes:

  • Add the missing <cstdint> include to battery_model.hpp so uint8_t is defined when the header is compiled.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds the header to battery_model.hpp to resolve compilation issues with fixed-width integer types. The feedback suggests ensuring that all files using these types include the header directly rather than relying on transitive includes and recommends using the std:: namespace for types like uint8_t for better C++ standard compliance.

#ifndef FFW_ROBOT_MANAGER__BATTERY_MODEL_HPP_
#define FFW_ROBOT_MANAGER__BATTERY_MODEL_HPP_

#include <cstdint>
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.

medium

While adding <cstdint> correctly resolves the compilation error in this header, there are a few related improvements to consider for full GCC 15 compatibility and standard compliance:

  1. Direct Inclusions: Other files in the package also use fixed-width integer types without directly including <cstdint> (e.g., uint16_t in ubetter_battery_model.hpp and uint32_t in ffw_robot_manager.cpp). Although they may currently receive the header transitively through this file, it is best practice for each file to include the headers it depends on directly.
  2. Namespace Qualification: In C++, types from <cstdint> are defined in the std namespace. It is recommended to use std::uint8_t, std::uint16_t, etc., instead of the global namespace versions (e.g., at line 68 of this file) for better portability and adherence to the C++ standard.

@yun-goon yun-goon self-assigned this Apr 2, 2026
@yun-goon
Copy link
Copy Markdown
Member

yun-goon commented Apr 2, 2026

Hi @nim65s
I will check this pr!

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