Skip to content

NRF52: build error, implicit conversion from 'float' to 'double' #17167

@permaBox

Description

@permaBox

Port, board and/or hardware

nrf port, nrf52 board

MicroPython version

mpy latest, nrf52 board

The build process has failed with a compiler configuration issue if support for double is configured.

Build error report:

CC ../../py/formatfloat.c
../../py/formatfloat.c: In function 'mp_format_float':
../../py/formatfloat.c:92:26: error: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Werror=double-promotion]
92 | #define fp_isless1(x) (x < 1.0)
| ^
../../py/formatfloat.c:183:16: note: in expansion of macro 'fp_isless1'
183 | } else if (fp_isless1(f)) {
| ^~~~~~~~~~
../../py/formatfloat.c:336:15: error: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Werror=double-promotion]
336 | f *= FPCONST(10.0);
| ^~
cc1: all warnings being treated as errors

Reproduction

mpconfigport.h

#if NRF51
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_NONE)
#else
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_DOUBLE)
#endif

Expected behaviour

No response

Observed behaviour

Related build error report.

Additional Information

No, I've provided everything above.

Code of Conduct

Yes, I agree

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy