PX4/Firmware — pull request #1189 by LorenzMeier (2014-07-16 07:31:26+00:00)
Title: Navigator cleanup

This PR adds stricter warning settings for Navigator and turns indeed up some relevant issues:

* Initialization was done with copy constructors but the classes contained pointers. This can lead to leaking pointers or having invalid pointers
* The init with copy constructors meant local allocations of a lot of class members, leading to excessive stack use at initialization time.
* Not all class members are guaranteed to be initialized properly. This is highly relevant. In particular since one of the uninitialized variables is related to #1179.

@julianoes @DrTon @thomasgubler Please help fixing this up.

@julianoes @DrTon this warning sounds a bit like #1179

```
/Users/user/src/Firmware/src/modules/navigator/navigator_main.cpp: In constructor 'Navigator::Navigator()':
/Users/user/src/Firmware/src/modules/navigator/navigator_main.cpp:95:1: warning: 'Navigator::_param_update_sub' should be initialized in the member initialization list [-Weffc++]
/Users/user/src/Firmware/src/modules/navigator/navigator_main.cpp:95:1: warning: 'Navigator::_can_loiter_at_sp' should be initialized in the member initialization list [-Weffc++]
/Users/user/src/Firmware/src/modules/navigator/navigator_main.cpp:95:1: warning: 'Navigator::_pos_sp_triplet_updated' should be initialized in the member initialization list [-Weffc++]
```

@thomasgubler In particular this part is for you:

```
/Users/user/src/Firmware/src//modules/fw_pos_control_l1/landingslope.h: In constructor 'Landingslope::Landingslope()':
/Users/user/src/Firmware/src//modules/fw_pos_control_l1/landingslope.h:63:2: warning: 'Landingslope::_landing_slope_angle_rad' should be initialized in the member initialization list [-Weffc++]
/Users/user/src/Firmware/src//modules/fw_pos_control_l1/landingslope.h:63:2: warning: 'Landingslope::_flare_relative_alt' should be initialized in the member initialization list [-Weffc++]
/Users/user/src/Firmware/src//modules/fw_pos_control_l1/landingslope.h:63:2: warning: 'Landingslope::_motor_lim_relative_alt' should be initialized in the member initialization list [-Weffc++]
/Users/user/src/Firmware/src//modules/fw_pos_control_l1/landingslope.h:63:2: warning: 'Landingslope::_H1_virt' should be initialized in the member initialization list [-Weffc++]
/Users/user/src/Firmware/src//modules/fw_pos_control_l1/landingslope.h:63:2: warning: 'Landingslope::_H0' should be initialized in the member initialization list [-Weffc++]
/Users/user/src/Firmware/src//modules/fw_pos_control_l1/landingslope.h:63:2: warning: 'Landingslope::_d1' should be initialized in the member initialization list [-Weffc++]
/Users/user/src/Firmware/src//modules/fw_pos_control_l1/landingslope.h:63:2: warning: 'Landingslope::_flare_constant' should be initialized in the member initialization list [-Weffc++]
/Users/user/src/Firmware/src//modules/fw_pos_control_l1/landingslope.h:63:2: warning: 'Landingslope::_flare_length' should be initialized in the member initialization list [-Weffc++]
/Users/user/src/Firmware/src//modules/fw_pos_control_l1/landingslope.h:63:2: warning: 'Landingslope::_horizontal_slope_displacement' should be initialized in the member initialization list [-Weffc++]
``