1 /* $NetBSD: msg_244.c,v 1.4 2023/07/07 19:45:22 rillig Exp $ */
2 # 3 "msg_244.c"
3
4 // Test for message: illegal structure pointer combination [244]
5
6 /* lint1-extra-flags: -X 351 */
7
8 struct a {
9 int member;
10 };
11
12 struct b {
13 int member;
14 };
15
16 int
diff(struct a * a,struct b * b)17 diff(struct a *a, struct b *b)
18 {
19 /* expect+1: error: illegal pointer subtraction [116] */
20 return a - b;
21 }
22
23 _Bool
lt(struct a * a,struct b * b)24 lt(struct a *a, struct b *b)
25 {
26 /* expect+1: warning: incompatible structure pointers: 'pointer to struct a' '<' 'pointer to struct b' [245] */
27 return a < b;
28 }
29
30 struct a *
ret(struct b * b)31 ret(struct b *b)
32 {
33 /* expect+1: warning: illegal structure pointer combination [244] */
34 return b;
35 }
36