atomic_inc_dec: improve how inc/dec is recorded in the DB
[smatch.git] / validation / Wcast-to-as.c
blob8c51209102f394b04957f21585dff8a88c586236
1 #define __user __attribute__((address_space(1)))
3 typedef __UINTPTR_TYPE__ uintptr_t;
4 typedef unsigned long ulong;
5 typedef struct s obj_t;
7 static void expl(ulong u, uintptr_t uip, void *v, obj_t *o, obj_t __user *p)
9 (obj_t*)(u);
10 (obj_t __user*)(u);
12 (obj_t*)(uip);
13 (obj_t __user*)(uip);
15 (obj_t*)(v);
16 (obj_t __user*)(v);
18 (ulong)(o);
19 (void *)(o);
20 (obj_t*)(o);
21 (obj_t __user*)(o);
23 (ulong)(p);
24 (obj_t __user*)(p);
29 * check-name: cast-to-as
30 * check-command: sparse -Wcast-to-as $file
32 * check-error-start
33 Wcast-to-as.c:16:10: warning: cast adds address space '<asn:1>' to expression
34 Wcast-to-as.c:21:10: warning: cast adds address space '<asn:1>' to expression
35 * check-error-end