modm-io / modm

modm: a C++23 library generator for AVR and ARM Cortex-M devices
https://modm.io
Mozilla Public License 2.0
747 stars 132 forks source link

Catch missing printf implementation #1120

Closed salkinium closed 9 months ago

salkinium commented 9 months ago

Accidental use of printf will use the Newlib implementation which uses heap, thus causing an error message about missing :platform:heap module. This is confusing and will lead to an unnecessary usage of the heap in addition to not getting any printf output.

This adds a dummy implementation of all printf methods and places them into a /DISCARD/ section just like the heap functions.