Skip to content

warning: 'float' is promoted to 'double' when passed through '...' when compiling on windows #14

Description

@stokie-ant

the full warning:

D:\Projects\lnDSO150\lnArduino\embedded_printf\printf.c: In function '_vsnprintf':
D:\Projects\lnDSO150\lnArduino\embedded_printf\printf.c:769:15: warning: 'float' is promoted to 'double' when passed through '...'
  769 |         idx = _ftoa(out, buffer, idx, maxlen, va_arg(va, FLOAT_SIZE_TYPE), precision, width, flags);
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:\Projects\lnDSO150\lnArduino\embedded_printf\printf.c:769:15: note: (so you should pass 'double' not 'float' to 'va_arg')
D:\Projects\lnDSO150\lnArduino\embedded_printf\printf.c:769:15: note: if this code is reached, the program will abort

and it does cause the program to abort, instantly.

Using mingw make and the toolchain from https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/tag/v10.2.1-1.1

solved with a SET(PLATFORM_C_FLAGS "-DPRINTF_DISABLE_SUPPORT_FLOAT ") in platformConfig.cmake

This is the first time for me with STM32 development and first time cross compiling with windows so please forgive me if this is my mis-configuration

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions