linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/2] avoid warnings for 'bool <- restricted' casts
@ 2017-05-19  2:47 Luc Van Oostenryck
  2017-05-19  2:47 ` [PATCH v3 1/2] avoid warning on implicit " Luc Van Oostenryck
  2017-05-19  2:47 ` [PATCH v3 2/2] avoid warning on explicit " Luc Van Oostenryck
  0 siblings, 2 replies; 3+ messages in thread
From: Luc Van Oostenryck @ 2017-05-19  2:47 UTC (permalink / raw)
  To: linux-sparse; +Cc: Al Viro, Luc Van Oostenryck

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-05-19  2:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-19  2:47 [PATCH v3 0/2] avoid warnings for 'bool <- restricted' casts Luc Van Oostenryck
2017-05-19  2:47 ` [PATCH v3 1/2] avoid warning on implicit " Luc Van Oostenryck
2017-05-19  2:47 ` [PATCH v3 2/2] avoid warning on explicit " Luc Van Oostenryck

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).