From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: linux-sparse@vger.kernel.org
Cc: Al Viro <viro@zeniv.linux.org.uk>,
Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Subject: [PATCH v3 0/2] avoid warnings for 'bool <- restricted' casts
Date: Fri, 19 May 2017 04:47:00 +0200 [thread overview]
Message-ID: <20170519024702.31443-1-luc.vanoostenryck@gmail.com> (raw)
The goal of this series is to stop to emit a warning
when a restricted type is casted to the boolean type
as such conversion is equivalent to a comparision
againts zero for which the 'restrictness' doesn't matter.
Change since v2:
- add tests for assignment to bool type.
- add patch & tests for explicit casts
Changes since v1:
- fix forgotten adjustment of 2 existing test cases.
Luc Van Oostenryck (2):
avoid warning on implicit 'bool <- restricted' casts
avoid warning on explicit 'bool <- restricted' casts
evaluate.c | 19 ++++++++++++++---
validation/bool-cast-bad.c | 4 ----
validation/bool-cast-explicit.c | 4 ----
validation/bool-cast-implicit.c | 3 ---
validation/bool-cast-restricted.c | 43 +++++++++++++++++++++++++++++++++++++++
5 files changed, 59 insertions(+), 14 deletions(-)
create mode 100644 validation/bool-cast-restricted.c
--
2.13.0
next reply other threads:[~2017-05-19 2:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-19 2:47 Luc Van Oostenryck [this message]
2017-05-19 2:47 ` [PATCH v3 1/2] avoid warning on implicit 'bool <- restricted' casts Luc Van Oostenryck
2017-05-19 2:47 ` [PATCH v3 2/2] avoid warning on explicit " Luc Van Oostenryck
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=20170519024702.31443-1-luc.vanoostenryck@gmail.com \
--to=luc.vanoostenryck@gmail.com \
--cc=linux-sparse@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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;
as well as URLs for NNTP newsgroup(s).