Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 [Bug] - Fix initialization order in RobotController #1319

Open
ladislas opened this issue Mar 10, 2023 · 0 comments
Open

🐛 [Bug] - Fix initialization order in RobotController #1319

ladislas opened this issue Mar 10, 2023 · 0 comments
Labels
01 - type: bug Report a bug or issue

Comments

@ladislas
Copy link
Member

Description

The current initialization order of RobotController has a lot of warnings:

In file included from /Users/ladislas/dev/leka/LekaOS/app/os/main.cpp:60:
/Users/ladislas/dev/leka/LekaOS/libs/RobotKit/include/RobotController.h: In instantiation of 'leka::RobotController<sm_t>::RobotController(leka::interface::Timeout&, leka::interface::Timeout&, leka::interface::Battery&, leka::SerialNumberKit&, leka::interface::FirmwareUpdate&, leka::interface::Motor&, leka::interface::Motor&, leka::interface::LED&, leka::interface::LED&, leka::interface::LedKit&, leka::interface::LCD&, leka::interface::VideoKit&, leka::BehaviorKit&, leka::CommandKit&, leka::RFIDKit&, leka::ActivityKit&) [with sm_t = boost::ext::sml::v1_1_6::back::sm<boost::ext::sml::v1_1_6::back::sm_policy<leka::system::robot::StateMachine, boost::ext::sml::v1_1_6::back::policies::logger<leka::system::robot::sm::logger>, boost::ext::sml::v1_1_6::back::policies::thread_safe<leka::CoreMutex> > >]':
/Users/ladislas/dev/leka/LekaOS/app/os/main.cpp:431:2:   required from here
/Users/ladislas/dev/leka/LekaOS/libs/RobotKit/include/RobotController.h:573:14: warning: 'leka::RobotController<boost::ext::sml::v1_1_6::back::sm<boost::ext::sml::v1_1_6::back::sm_policy<leka::system::robot::StateMachine, boost::ext::sml::v1_1_6::back::policies::logger<leka::system::robot::sm::logger>, boost::ext::sml::v1_1_6::back::policies::thread_safe<leka::CoreMutex> > > >::_cmdkit' will be initialized after [-Wreorder]
  573 |  CommandKit &_cmdkit;
      |              ^~~~~~~
/Users/ladislas/dev/leka/LekaOS/libs/RobotKit/include/RobotController.h:569:11: warning:   'leka::RFIDKit& leka::RobotController<boost::ext::sml::v1_1_6::back::sm<boost::ext::sml::v1_1_6::back::sm_policy<leka::system::robot::StateMachine, boost::ext::sml::v1_1_6::back::policies::logger<leka::system::robot::sm::logger>, boost::ext::sml::v1_1_6::back::policies::thread_safe<leka::CoreMutex> > > >::_rfidkit' [-Wreorder]
  569 |  RFIDKit &_rfidkit;
      |           ^~~~~~~~
/Users/ladislas/dev/leka/LekaOS/libs/RobotKit/include/RobotController.h:50:11: warning:   when initialized here [-Wreorder]
   50 |  explicit RobotController(interface::Timeout &timeout_state_internal, interface::Timeout &timeout_state_transition,
      |           ^~~~~~~~~~~~~~~

We need to fix that as it could be causing bugs.

Related epic/story/task:

@ladislas ladislas added the 01 - type: bug Report a bug or issue label Mar 10, 2023
@ladislas ladislas added this to the Future Release milestone Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
01 - type: bug Report a bug or issue
Projects
None yet
Development

No branches or pull requests

1 participant