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

remove std::vector usage #11152

Closed
dagar opened this issue Jan 6, 2019 · 1 comment · Fixed by #11242
Closed

remove std::vector usage #11152

dagar opened this issue Jan 6, 2019 · 1 comment · Fixed by #11242

Comments

@dagar
Copy link
Member

dagar commented Jan 6, 2019

In several of the distance sensor drivers usage of std::vector has slipped in. This needs to be fixed because std::vector either needs exceptions (PX4 isn't built with c++ exceptions) or a custom allocator. Additionally we need to get the system (toolchain) c++ include path out of the NuttX build to prevent the messy mix of NuttX cxx (https://github.com/PX4/NuttX/tree/px4_firmware_nuttx-7.22%2B/include/cxx) and libstdc++ from the arm-none-eabi-gcc toolchain. @davids5 I believe this is the real reason we're carrying the cstdint fix (PX4/NuttX@198f877).

TODO:

  1. remove std::vector usage from these drivers
  2. Update PX4 usage of all cxx includes not provided by NuttX cxx (cfloat, cinttypes, etc)
  3. Start using -nostdinc++ to prevent future mistakes.
  4. Reevaluate using LLVM libc++ (long term)
@dagar
Copy link
Member Author

dagar commented Jan 7, 2019

I believe all of the existing usage is to allow each of these drivers to handle multiple sensors. I would propose dropping all of this and extending the module (/driver) itself to run multiple instances. https://github.com/PX4/Firmware/blob/8ae3f5009549707eca936cf82becf165f74f1abc/src/drivers/distance_sensor/srf02/srf02.cpp#L608-L610

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant