1 void f00(void *restrict dst
);
2 void f01(void *restrict
*dst
);
3 void f02(void *restrict
*dst
);
4 void f03(void *restrict
*dst
);
9 void f00(void *dst
) { } /* check-should-pass */
10 void f01(typeof(&rp
) dst
) { } /* check-should-pass */
11 void f02(void **dst
) { } /* check-should-fail */
12 void f03(typeof(&up
) dst
) { } /* check-should-fail */
16 rp
= up
; /* check-should-pass */
17 up
= rp
; /* check-should-pass */
24 extern void *const *pqp
;
27 pqp
= &qp
; /* check-should-pass */
28 pqp
= &up
; /* check-should-pass */
31 pup
= &up
; /* check-should-pass */
33 pup
= &qp
; /* check-should-fail */
34 pup
= pqp
; /* check-should-fail */
39 extern void *restrict
*prp
;
42 prp
= &rp
; /* check-should-pass */
43 prp
= &up
; /* check-should-pass */
46 pup
= &up
; /* check-should-pass */
48 pup
= &rp
; /* check-should-fail */
49 pup
= prp
; /* check-should-fail */
54 extern typeof(&rp
) prp
;
55 extern typeof(&up
) pup
;
57 prp
= &rp
; /* check-should-pass */
58 prp
= &up
; /* check-should-pass */
61 pup
= &up
; /* check-should-pass */
63 pup
= &rp
; /* check-should-fail */
64 pup
= prp
; /* check-should-fail */
68 * check-name: restrict qualifier
69 * check-command: sparse -Wno-decl $file
72 restrict.c:11:6: error: symbol 'f02' redeclared with different type (incompatible argument 1 (different modifiers)):
73 restrict.c:11:6: void extern [addressable] [toplevel] f02( ... )
74 restrict.c:3:6: note: previously declared as:
75 restrict.c:3:6: void extern [addressable] [toplevel] f02( ... )
76 restrict.c:12:6: error: symbol 'f03' redeclared with different type (incompatible argument 1 (different modifiers)):
77 restrict.c:12:6: void extern [addressable] [toplevel] f03( ... )
78 restrict.c:4:6: note: previously declared as:
79 restrict.c:4:6: void extern [addressable] [toplevel] f03( ... )
80 restrict.c:33:13: warning: incorrect type in assignment (different modifiers)
81 restrict.c:33:13: expected void **extern [assigned] pup
82 restrict.c:33:13: got void *const *
83 restrict.c:34:13: warning: incorrect type in assignment (different modifiers)
84 restrict.c:34:13: expected void **extern [assigned] pup
85 restrict.c:34:13: got void *const *extern [assigned] pqp
86 restrict.c:48:13: warning: incorrect type in assignment (different modifiers)
87 restrict.c:48:13: expected void **extern [assigned] pup
88 restrict.c:48:13: got void *restrict *
89 restrict.c:49:13: warning: incorrect type in assignment (different modifiers)
90 restrict.c:49:13: expected void **extern [assigned] pup
91 restrict.c:49:13: got void *restrict *extern [assigned] prp
92 restrict.c:63:13: warning: incorrect type in assignment (different modifiers)
93 restrict.c:63:13: expected void **extern [assigned] pup
94 restrict.c:63:13: got void *restrict *
95 restrict.c:64:13: warning: incorrect type in assignment (different modifiers)
96 restrict.c:64:13: expected void **extern [assigned] pup
97 restrict.c:64:13: got void *restrict *extern [assigned] prp