From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: linux-sparse@vger.kernel.org
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Christopher Li <sparse@chrisli.org>,
Dibyendu Majumdar <mobile@majumdar.org.uk>,
Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Subject: [RFC PATCH 02/14] cast: add tests for warnings issued by sparse -v
Date: Thu, 17 Aug 2017 06:05:17 +0200 [thread overview]
Message-ID: <20170817040529.7289-3-luc.vanoostenryck@gmail.com> (raw)
In-Reply-To: <20170817040529.7289-1-luc.vanoostenryck@gmail.com>
The sparse command (aka the 'checker') do a number of additional
checks when used with the -v flag. I strongly believes that this
option is rarely used let me not disgress about it here.
One of this additional checks are about casts.
Let add soe testcase in thr tessuite in order to avoid any
regression there.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
validation/cast-kinds-check.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
create mode 100644 validation/cast-kinds-check.c
diff --git a/validation/cast-kinds-check.c b/validation/cast-kinds-check.c
new file mode 100644
index 000000000..f3ece313a
--- /dev/null
+++ b/validation/cast-kinds-check.c
@@ -0,0 +1,26 @@
+#include "cast-kinds.c"
+
+/*
+ * check-name: cast-kinds check
+ * check-command: sparse -m64 -v $file
+ *
+ * check-error-start
+cast-kinds.c:5:45: warning: cast drops bits
+cast-kinds.c:6:47: warning: cast drops bits
+cast-kinds.c:7:46: warning: cast drops bits
+cast-kinds.c:8:45: warning: cast drops bits
+cast-kinds.c:10:49: warning: cast drops bits
+cast-kinds.c:12:48: warning: cast drops bits
+cast-kinds.c:13:50: warning: cast drops bits
+cast-kinds.c:14:49: warning: cast drops bits
+cast-kinds.c:15:48: warning: cast drops bits
+cast-kinds.c:17:52: warning: cast drops bits
+cast-kinds.c:21:49: warning: cast wasn't removed
+cast-kinds.c:22:48: warning: cast wasn't removed
+cast-kinds.c:28:52: warning: cast wasn't removed
+cast-kinds.c:29:51: warning: cast wasn't removed
+cast-kinds.c:34:52: warning: cast wasn't removed
+cast-kinds.c:35:54: warning: cast wasn't removed
+cast-kinds.c:36:52: warning: cast wasn't removed
+ * check-error-end
+ */
--
2.14.0
next prev parent reply other threads:[~2017-08-17 4:05 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-17 4:05 [RFC PATCH 00/14] rework of cast operations Luc Van Oostenryck
2017-08-17 4:05 ` [RFC PATCH 01/14] add documentation for IR instructions Luc Van Oostenryck
2017-08-21 12:18 ` Christopher Li
2017-08-17 4:05 ` Luc Van Oostenryck [this message]
2017-08-17 4:05 ` [RFC PATCH 03/14] cast: prepare finer grained cast instructions Luc Van Oostenryck
2017-08-17 4:05 ` [RFC PATCH 04/14] cast: specialize FPCAST into [USF]CVTF Luc Van Oostenryck
2017-08-17 4:05 ` [RFC PATCH 05/14] cast: handle NO-OP casts Luc Van Oostenryck
2017-08-17 4:05 ` [RFC PATCH 06/14] cast: specialize floats to integer conversion Luc Van Oostenryck
2017-08-17 4:05 ` [RFC PATCH 07/14] cast: specialize casts from unsigned to pointers Luc Van Oostenryck
2017-08-17 4:05 ` [RFC PATCH 08/14] cast: make [u]intptr_ctype alias of [s]size_t_ctype Luc Van Oostenryck
2017-08-17 4:05 ` [RFC PATCH 09/14] cast: make pointer casts always size preserving Luc Van Oostenryck
2017-08-17 4:05 ` [RFC PATCH 10/14] cast: temporary simplify handling cast to/from void* Luc Van Oostenryck
2017-08-17 4:05 ` [RFC PATCH 11/14] cast: specialize cast from pointers Luc Van Oostenryck
2017-08-17 4:05 ` [RFC PATCH 12/14] cast: add support for -Wpointer-to-int-cast Luc Van Oostenryck
2017-08-17 4:05 ` [RFC PATCH 13/14] cast: make casts from pointer always size preserving Luc Van Oostenryck
2017-08-17 4:05 ` [RFC PATCH 14/14] cast: specialize integer casts 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=20170817040529.7289-3-luc.vanoostenryck@gmail.com \
--to=luc.vanoostenryck@gmail.com \
--cc=linux-sparse@vger.kernel.org \
--cc=mobile@majumdar.org.uk \
--cc=sparse@chrisli.org \
--cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).