Re: [PATCH] add __builtin functions for isinf_sign, isfinite and isnan

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Nov 17, 2017 at 5:27 AM, Logan Gunthorpe <logang@xxxxxxxxxxxx> wrote:
> These bultins are defined by in gcc since 4.4. They are also now
> used by the isinf, isfinite and isnan macros. So using them with a
> newer gcc causes 'undefined identifier' errors.
>
> Add the builtin definitions and some validation checks for these
> functions.

Thanks for the patch.

> diff --git a/validation/builtin_inf.c b/validation/builtin_inf.c
> index 48546e4..0855ab0 100644
> --- a/validation/builtin_inf.c
> +++ b/validation/builtin_inf.c
> @@ -7,6 +7,14 @@ static long double li = __builtin_infl();
>  static double dn = __builtin_nan("");
>  static float fn = __builtin_nanf("");
>  static long double ln = __builtin_nanl("");
> +static int inf = __builtin_isinf_sign(0.0);
> +static int fin = __builtin_isfinite(0.0);
> +static int nan = __builtin_isnan(0.0);
> +
> +#include <math.h>

Can you remove the <math.h>?

For the validation test, it would be best to not depend on
system header file. You can use sparse -E to dig out the
related function call after the pre-process.

Other than that, it looks good.

I want to apply with the math.h removed.

Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux