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