In our embedded project, targeted for the ARM Cortex M* cores, we are using the ARM clang-based toolchain (v6). We use float
type for our floating-point math. As we try to minimize footprint, we found out that some space is taken by unnecessary double
<->float
conversions.
The source of some of those conversions was the use of literals not including the f
specifier (e.g., use 12.34
instead of 12.34f
). To eliminate that, I am looking for a compiler option that uses float
type by default. Looking at the compiler documentation and at the general clang help, I could not find any.
Is there any option (command option, pragma, attribute, etc.) that can achieve that goal?