Changing main.c to cpp adds floating point routines to the binary & increases size - why?
I have a STM32CubeIDE project for a stm32f091, using LL drivers for everything.
So I initially used the Cube-generated project structure with its main.c file.
In an attempt to decrease the binary size (irony alert!) I converted the large GPIO init routine with lots of repated GPIO initialization code to one what uses a compact const array of struct storage for the GPIO / init info, and a small code block in a loop to do the config.
To do that more conveniently I used some own helper library header with compile-time computation and "packing" stuff heavily reliant on the "constexpr" keyword.
So I changed main.c into main.cpp. i.e. having it compile with C++.
(the vast majority of the project was already C++, btw.)
I did not change anything in the project but that (I just looked at the git diff), added no computations that use float or anything.
But now instead of smaller, my binary is ~ 10KB bigger, and 7KB of that are from items in the .text section which were not present before:
- __aeabi_dsub
- __aeabi_dadd
- __aeabi_ddiv
- __aeabi_dmul
- __ieee754_log
I can't quite explain why these things are in there now.
I tried to inspect the .map file to maybe see what's using it, but anything listed that mentions any of those above are seemingly library things, I can't see any of my stuff using it.
What's going on? Can I get rid of that?
