This is the case in arm-none-eabi-gcc 14.2.1 (debian trixie).
This fixes a diagnostic like:
../../lib/libm_dbl/libm.h:92:9: error:
"DBL_EPSILON" redefined [-Werror]
/usr/lib/gcc/arm-none-eabi/14.2.1/include/float.h:114:9: note:
this is the location of the previous definition
when building MPS2_AN500 (qemu port).
Signed-off-by: Jeff Epler <jepler@unpythonic.net>
That's almost the same as FLT_EVAL_METHOD == 0, but indicates the
presence of _Float16_t support.
Signed-off-by: Damien George <damien@micropython.org>
Since C99, `FLT_EVAL_METHOD` should be left for the compiler/libc to
define. Its redefinition breaks compilation with picolibc as the
target's libc, since it defines said symbol in math.h before the libm
define is evaluated by the compiler.
In its place, there is a check to make sure floating point type sizes
are what are expected to be, triggering a compilation error if those
assumptions are no longer valid.
Co-authored-by: Angus Gratton <angus@redyak.com.au>
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
This code is imported from musl, to match existing code in libm_dbl.
The file is also added to the build in stm32/Makefile. It's not needed by
the core code but, similar to c5cc64175b,
allows round() to be used by user C modules or board extensions.