Linux SPARSE checker discussions
 help / color / mirror / Atom feed
From: Logan Gunthorpe <logang@deltatee.com>
To: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Cc: Linux-Sparse <linux-sparse@vger.kernel.org>,
	Christopher Li <sparse@chrisli.org>
Subject: Re: [PATCH v2] add __builtin functions for isinf_sign, isfinite and isnan
Date: Fri, 17 Nov 2017 16:39:37 -0700	[thread overview]
Message-ID: <b16d895e-d4fa-3590-4f0d-b9c0e8a754d3@deltatee.com> (raw)
In-Reply-To: <CAExDi1QA-NV0JYKnOzxxnkLfimzr9Bw6Q0irKxmmnByfP5XeWA@mail.gmail.com>



On 17/11/17 04:28 PM, Luc Van Oostenryck wrote:
> 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).

This is true, but when I test with the validation suite sparse does not 
seem to complain if it's a long double, double or float. So I don't 
really see an actual issue.

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

Yes, though GCC's documentation is less than clear on all that are 
available... I only added ones I knew to exist based on the code I'm 
working on and examining the system headers.

Logan

      reply	other threads:[~2017-11-17 23:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-16 23:08 [PATCH v2] add __builtin functions for isinf_sign, isfinite and isnan Logan Gunthorpe
2017-11-17  0:02 ` Christopher Li
2017-11-17  1:04   ` Logan Gunthorpe
2017-11-17  8:13 ` Luc Van Oostenryck
2017-11-17 23:28   ` Luc Van Oostenryck
2017-11-17 23:39     ` Logan Gunthorpe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b16d895e-d4fa-3590-4f0d-b9c0e8a754d3@deltatee.com \
    --to=logang@deltatee.com \
    --cc=linux-sparse@vger.kernel.org \
    --cc=luc.vanoostenryck@gmail.com \
    --cc=sparse@chrisli.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox