3 ms·
Why are embedded developers unnerved by the concept of a featureful standard library? There are Linux distributions aimed at statically compiled, musl-based pac
by papermachete 7y ago
Why are embedded developers unnerved by the concept of a featureful standard library? There are Linux distributions aimed at statically compiled, musl-based packages, hence you can very much choose what you need for your project.
Look at C++'s std::string in GCC, Clang, and MSVC's standard libraries and respectively its development history. Of course you can make a minimalistic standard string and also eliminate nullpointer checks, trailing \0 checks (everyone passes size_t len anyways), and allocation issues in runtime.
The only standard thing about C strings are vulnerabilities.
- umvi 7y agoI used to work on routers that essentially ran embedded linux inside and our new projects started all being c++ after a while. It's amazing after the switch to c++, we basically stopped ever seeing string/array related segmentation faults now that developers use std string/vector/etc by default. Yeah, it's more resource expensive, but we have plenty of RAM now on these boards and it's totally worth not having a maintenence nightmare like our legacy C projects which I swear get a new bug report every other month about a newly discovered string/array-related segmentation fault (I'm not saying C++ can't ever be a maintenance nightmare, to be clear, but as far as memory related issues go, they disappeared the moment we started using std library).
- papermachete 7y agoInteresting, did you make your own allocators? Can you tell me the company?