aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-12-15 06:39:51 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-12-17 23:19:34 +0100
commit6002ded74587a1469fcd930dd46dc89eb3307982 (patch)
treee508674afaf319fe04d2b08e73c6f50fbfa82cc7 /validation
parent45503a2bb1cbd400fe5aa01041cae3bf484b205b (diff)
downloadsparse-dev-6002ded74587a1469fcd930dd46dc89eb3307982.tar.gz
add a flag to warn on casts to/from bitwise pointers
Support for 'bitwise' integers is one of the main sparse's extension. However, casts to or from pointers to bitwise types can be done without incurring any sort of warnings although such casts can be as wrong as direct casts to or from bitwise integers themselves. Add the corresponding warnings and control them by a new flag -Wbitwise-pointer (defaulting to off as it creates tens of thousands warnings in the kernel). CC: Thiebaud Weksteen <tweek@google.com> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation')
-rw-r--r--validation/bitwise-cast-ptr.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/validation/bitwise-cast-ptr.c b/validation/bitwise-cast-ptr.c
index acf0ac35..3f2bfdaf 100644
--- a/validation/bitwise-cast-ptr.c
+++ b/validation/bitwise-cast-ptr.c
@@ -22,8 +22,7 @@ static __be32* tobf(u32 *x)
/*
* check-name: cast of bitwise pointers
- * check-command: sparse -Wbitwise $file
- * check-known-to-fail
+ * check-command: sparse -Wbitwise -Wbitwise-pointer $file
*
* check-error-start
bitwise-cast-ptr.c:9:16: warning: incorrect type in return expression (different base types)