From: Christoph Hellwig <hch@infradead.org>
To: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Cc: Christoph Hellwig <hch@infradead.org>,
linux-sparse@vger.kernel.org, linux-xfs@vger.kernel.org
Subject: Re: sparse feature request: nocast integer types
Date: Wed, 8 Nov 2023 21:30:11 -0800 [thread overview]
Message-ID: <ZUxuY13JnQ8IIFd1@infradead.org> (raw)
In-Reply-To: <CAMHZB6G_TZJ_uQGm5an0-bhG8wCxpEQrUCShen7O61Q9arAf+Q@mail.gmail.com>
On Thu, Nov 09, 2023 at 06:21:05AM +0100, Luc Van Oostenryck wrote:
> Such 'nocast' attribute already exists and seems to do more or less what
> you would like:
> See Sparse docs at https://sparse.docs.kernel.org/en/latest/annotations.html
> :
> nocast <https://sparse.docs.kernel.org/en/latest/annotations.html#nocast>
>
> This attribute is similar to bitwise but in a much weaker form. It warns
> about explicit or implicit casting to different types. However, it doesn’t
> warn about the mixing with other types and it easily gets lost: you can add
> plain integers to __nocast integer types and the result will be plain
> integers.
Hmm, that's a little suboptimal. But still a lot better than nothing.
I'll see what I can do with them.
Thanks a lot!
next prev parent reply other threads:[~2023-11-09 5:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-09 5:03 sparse feature request: nocast integer types Christoph Hellwig
[not found] ` <CAMHZB6G_TZJ_uQGm5an0-bhG8wCxpEQrUCShen7O61Q9arAf+Q@mail.gmail.com>
2023-11-09 5:30 ` Christoph Hellwig [this message]
[not found] ` <CAMHZB6H7Y0m2Y-ZD0PMKiGDeo7_sy=scDrzbBbBuUJfuzLK-Lg@mail.gmail.com>
2023-11-09 5:44 ` Christoph Hellwig
2023-11-09 17:57 ` Linus Torvalds
2023-11-27 12:51 ` Dan Carpenter
2023-11-27 16:05 ` Christoph Hellwig
2023-11-27 17:26 ` Linus Torvalds
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=ZUxuY13JnQ8IIFd1@infradead.org \
--to=hch@infradead.org \
--cc=linux-sparse@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=luc.vanoostenryck@gmail.com \
/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