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

fix variable length warning using std::vector #364

Conversation

ijnek
Copy link
Contributor

@ijnek ijnek commented Sep 21, 2022

Resolves: ROBOTIS-GIT/DynamixelSDK#553

Gets rid of the following warning:

Starting >>> dynamixel_workbench_toolbox
--- stderr: dynamixel_workbench_toolbox                              
/home/ijnek/tmp_workspaces/dynamixel_control_ws/src/dynamixel-workbench/dynamixel_workbench_toolbox/src/dynamixel_workbench_toolbox/dynamixel_driver.cpp: In member function ‘bool DynamixelDriver::readRegister(uint8_t, uint16_t, uint16_t, uint32_t*, const char**)’:
/home/ijnek/tmp_workspaces/dynamixel_control_ws/src/dynamixel-workbench/dynamixel_workbench_toolbox/src/dynamixel_workbench_toolbox/dynamixel_driver.cpp:776:11: warning: ISO C++ forbids variable length array ‘data_read’ [-Wvla]
  776 |   uint8_t data_read[length];
      |           ^~~~~~~~~
/home/ijnek/tmp_workspaces/dynamixel_control_ws/src/dynamixel-workbench/dynamixel_workbench_toolbox/src/dynamixel_workbench_toolbox/dynamixel_driver.cpp: In member function ‘bool DynamixelDriver::syncWrite(uint8_t, uint8_t*, uint8_t, int32_t*, uint8_t, const char**)’:
/home/ijnek/tmp_workspaces/dynamixel_control_ws/src/dynamixel-workbench/dynamixel_workbench_toolbox/src/dynamixel_workbench_toolbox/dynamixel_driver.cpp:1012:11: warning: ISO C++ forbids variable length array ‘multi_parameter’ [-Wvla]
 1012 |   uint8_t multi_parameter[4*data_num_for_each_id];
      |           ^~~~~~~~~~~~~~~
---

I accidentally closed #363, so this is an identical PR to that.

@ijnek
Copy link
Contributor Author

ijnek commented Oct 4, 2022

Ping @ROBOTIS-Will , thanks!

@ROBOTIS-Will ROBOTIS-Will changed the base branch from ros2 to ros2-devel October 6, 2022 06:07
@ROBOTIS-Will
Copy link
Contributor

@ijnek
Thanks for the contribution!

@ROBOTIS-Will ROBOTIS-Will changed the base branch from ros2-devel to ros2 October 6, 2022 08:09
@ROBOTIS-Will ROBOTIS-Will changed the base branch from ros2 to ros2-devel October 6, 2022 08:09
@ROBOTIS-Will ROBOTIS-Will merged commit 0e8e600 into ROBOTIS-GIT:ros2-devel Oct 6, 2022
@ijnek ijnek deleted the ijnek-fix-variable-length-array-warning-2 branch October 6, 2022 09:14
@ijnek
Copy link
Contributor Author

ijnek commented Oct 6, 2022

Thanks @ROBOTIS-Will

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