Re: [PATCH] iio: tools: Use proper macro to detect _Float16 support

From: Andy Shevchenko

Date: Sat Sep 19 2026 - 10:04:58 EST


On Fri, Sep 18, 2026 at 08:13:02PM +0400, Ivan A. Melnikov wrote:
> __FLT16_MAX__ is an internal compiler macro. GCC defines it if
> _Float16 is supported by the target in general, but the support
> may depend on the exact target options. For example, on i586
> without -msse2 I get the following error from GCC15:
>
> iio_generic_buffer.c: In function 'print2byte':
> iio_generic_buffer.c:141:17: error: invalid conversion from type '_Float16' without option '-msse2'
> 141 | printf("%05f ", ((float)converter.f + info->offset) * info->scale);
> | ^~~~~~
>
> To fix that, use the public macro without double underscores.

What about clang?

--
With Best Regards,
Andy Shevchenko