freebsd-src/lib/msun
Martin Oliveira 4309f9f234 include/math.h: fix warning with -Wconversion
The way the __fp_type_select macro uses the _Generic expression causes
gcc to throw a warning on valid code if the -Wconversion flag is used.

For example, consider the following program:

    #include <math.h>
    int main()
    {
    	double x = 1.0;
    	isnan(x);
    	return 0;
    }

which throws a warning:

    $ gcc -Wconversion a.c
    a.c:5:15: warning: conversion from 'double' to 'float' may change value [-Wfloat-conversion]
        5 |         isnan(x);
          |               ^

This happens because the functions are invoked inside of the _Generic.
Looking at the example of _Generic in the C11 specification, one sees
that the parameters are outside of the _Generic expression (see page 79
here: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf).

Reference: https://stackoverflow.com/a/68309379
Signed-off-by: Martin Oliveira <martin.oliveira@eideticom.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/841
2024-02-02 21:05:49 -07:00
..
aarch64 Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
amd64 lib: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
arm Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
bsdsrc lib/msun: Cleanup after $FreeBSD$ removal 2024-01-28 17:00:23 +02:00
i387 lib/msun: Cleanup after $FreeBSD$ removal 2024-01-28 17:00:23 +02:00
ld80 lib/msun: Cleanup after $FreeBSD$ removal 2024-01-28 17:00:23 +02:00
ld128 lib/msun: Cleanup after $FreeBSD$ removal 2024-01-28 17:00:23 +02:00
man lib: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
powerpc Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
riscv Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
src include/math.h: fix warning with -Wconversion 2024-02-02 21:05:49 -07:00
tests lib/msun: Cleanup after $FreeBSD$ removal 2024-01-28 17:00:23 +02:00
x86 Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:16 -06:00
Makefile msun: remove fabs from Symbol.map, and adjust comment 2024-01-27 22:24:38 +01:00
Makefile.depend dirdeps: Update/fix Makefile.depend* for toolchain 2023-11-26 20:50:13 -05:00
Symbol.map msun: remove fabs from Symbol.map, and adjust comment 2024-01-27 22:24:38 +01:00