ros / dynamic_reconfigure

BSD 3-Clause "New" or "Revised" License
48 stars 111 forks source link

CPP client compile error with [-Werror=reorder] #117

Open jubeira opened 5 years ago

jubeira commented 5 years ago

When including dynamic_reconfigure/client.h in a project with reorder error flag (or -Wall) a compile time error occurs. This is the output cleaning up unnecessary details:

/opt/ros/kinetic/include/dynamic_reconfigure/client.h:327:19: error: ‘dynamic_reconfigure::Client<ConfigType>::nh_’ will be initialized after [-Werror=reorder]
   ros::NodeHandle nh_;
                   ^
/opt/ros/kinetic/include/dynamic_reconfigure/client.h:326:8: error:   ‘bool dynamic_reconfigure::Client<ConfigType>::received_configuration_’ [-Werror=reorder]
   bool received_configuration_;
        ^
/opt/ros/kinetic/include/dynamic_reconfigure/client.h:68:3: error:   when initialized here [-Werror=reorder]
   Client(

This is because the NodeHandle is initialized before received_configuration_ boolean in the constructor, but it is declared afterwards in the private variables. I'll send a small PR with the fix.