Electrical – What features of C++ lead to extra resource usage that I should be aware of when developing for an embedded system

cembeddedmicrocontroller

Some features of C++ have implied run-time cost or can lead to significant code size increases. Which features should I consider avoiding when developing for a bare-metal resource constrained microcontroller? And why?

Best Answer

Look at the MISRA (Motor Industry Software Reliability Association) guidelines for safe C. They were designed specifically for coding in C and C++ for embedded application.

Wikipedia: https://en.wikipedia.org/wiki/MISRA_C

And the MISRA-C home page: http://www.misra-c.com/