Unfortunately yes, I just tried and for otherwise unused function it makes it bigger with this. But without this it probably gets optimized out because it is not directly called so LTO removes it(?). Or it is built in a way that linker does not expect later when searching for it - LTO may add some additional flags or mangling(?) that this method in standard library is not expected to have.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Unfortunately yes, I just tried and for otherwise unused function it makes it bigger with this. But without this it probably gets optimized out because it is not directly called so LTO removes it(?). Or it is built in a way that linker does not expect later when searching for it - LTO may add some additional flags or mangling(?) that this method in standard library is not expected to have.
EDIT: some info is in https://gcc.gnu.org/wiki/LinkTimeOptimizationFAQ that's where I got the
__attribute__((used))
idea from