aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2017-04-05 18:18:54 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2017-06-10 16:00:01 +0200
commitac0636468531f36d47708e121a5c94b6b9d142f7 (patch)
treeec5adc86f5df1772c95dc884a50c6b72362214e2 /validation
parent88578349140acf4405b768a60be05e10b7b8b158 (diff)
downloadsparse-dev-ac0636468531f36d47708e121a5c94b6b9d142f7.tar.gz
use NULL instead of 0 in testcases.
Sparse, normally emit a warning when 0 is used when a pointer is expected but here these warnings were not emitted because errors occured before these warnings have been emitted and sparse doesn't emit any warnings as soon as an error has been encountered. However, there is some changes coming regarding how previous errors inhibit warnings and with these changes these warnings "0 instead of NULL" will now be emitted. Prevent to have to emit these warning by using NULL instead of 0, as it should always be. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation')
-rw-r--r--validation/function-redecl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/validation/function-redecl.c b/validation/function-redecl.c
index 7fbceb43..475f18e7 100644
--- a/validation/function-redecl.c
+++ b/validation/function-redecl.c
@@ -1,5 +1,5 @@
#define __user __attribute__((address_space(1)))
-
+#define NULL ((void*)0)
int ret_type(void);
void ret_type(void) { } /* check-should-fail */
@@ -10,11 +10,11 @@ int const ret_const(void) { return 0; } /* check-should-fail */
void *ret_as(void);
-void __user *ret_as(void) { return 0; } /* check-should-fail */
+void __user *ret_as(void) { return NULL; } /* check-should-fail */
void *ret_mod(void);
-void const *ret_mod(void) { return 0; } /* check-should-fail */
+void const *ret_mod(void) { return NULL; } /* check-should-fail */
void arg_type(int a);