Re: [PATCH v2] 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 9:13 AM, Luc Van Oostenryck
<luc.vanoostenryck@xxxxxxxxx> wrote:
> On Thu, Nov 16, 2017 at 04:08:17PM -0700, Logan Gunthorpe 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.
>>
>> Signed-off-by: Logan Gunthorpe <logang@xxxxxxxxxxxx>
>
> Acked-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>

Hmmm, looking at this closer, I only notice now that those builtins
are of the type-generic kind. Declaring them with a prototype as if
taking a float won't play nicely once you use them with a double or
a long double. Alas, there is not yet real support for type-generic
builtins. One solution would be:
        extern int __builtin_isfinite(long double);
Another one would be to use:
        extern int __builtin_isfinite(...);
but that is not C99 compliant (not sure if sparse complain).

Note, that there is also a few more builtins of the same family.

-- Luc Van Oostenryck
--
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