Skip to content

gcc - newlib - floating numbers printf/scanf (configure for targets, cleanup required) #2012

Closed
@0xc0170

Description

@0xc0170

There's the if condition for some tagets on the line https://github.com/mbedmicro/mbed/blob/master/tools/toolchains/gcc.py#L287 .

Here's the code snippet:


if target.name in ["LPC1768", "LPC4088", "LPC4088_DM", "LPC4330", "UBLOX_C027", "LPC2368", "ARM_BEETLE_SOC"]:
    self.ld.extend(["-u _printf_float", "-u _scanf_float"])
elif target.name in ["RZ_A1H", "VK_RZ_A1H", "ARCH_MAX", "DISCO_F407VG", "DISCO_F429ZI", "DISCO_F469NI", "NUCLEO_F401RE", "NUCLEO_F410RB", "NUCLEO_F411RE", "NUCLEO_F446RE", "ELMO_F411RE", "MTS_MDOT_F411RE", "MTS_DRAGONFLY_F411RE", "DISCO_F746NG"]:
    self.ld.extend(["-u_printf_float", "-u_scanf_float"])

We should investigate why there's -u_printf_float vs -u _printf_float (different GCC ARM versions?), plus looks at this if/else - either provide a configuration option, or follow the other toolchains. IAR and ARMCC full stdlib provide floating support. uLib does not as I recall (something to check).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions