-Wl,-u -Wl,_printf_float

IDE Equivalent

GCC C Linker > Miscellaneous > Enable floating point printing

Syntax

-Wl,-u -Wl,_printf_float

Arguments

NONE

Default

OFF

Description

Adds floating point printing support for printf-family functions.

By default, when one prints float-point numbers from printf-family function ( sprint, printf , fprintf, etc.) by using formatting string like "%f", nothing is printed. This is because float-point printing code is large although is rarely used in MCUs. Therefore floating point printing is turned off by default. To turn it on, pass -Wl,-u -Wl,_printf_float to the gcc command-line.

Note that this will increase the size of your binary.

For more complete information about compiler optimizations, see our Optimization Notice.