xref: /netbsd-src/tests/usr.bin/xlint/lint1/msg_128.c (revision 88d1eb2324a18ae9aa3cebcfbef602456b96bcb6)
1 /*	$NetBSD: msg_128.c,v 1.9 2024/11/23 00:01:48 rillig Exp $	*/
2 # 3 "msg_128.c"
3 
4 // Test for message: operator '%s' discards '%s' from '%s' [128]
5 
6 /* lint1-extra-flags: -X 351 */
7 
8 char *ptr;
9 const char *cptr;
10 volatile char *vptr;
11 const volatile char *cvptr;
12 
13 const volatile int *cviptr;
14 
15 void
16 assign(void)
17 {
18 	/* expect+1: warning: operator '=' discards 'const volatile' from 'pointer to const volatile char' [128] */
19 	ptr = cvptr;
20 	/* expect+1: warning: operator '=' discards 'volatile' from 'pointer to const volatile char' [128] */
21 	cptr = cvptr;
22 	/* expect+1: warning: operator '=' discards 'const' from 'pointer to const volatile char' [128] */
23 	vptr = cvptr;
24 
25 	/* expect+1: warning: illegal combination of 'pointer to char' and 'pointer to const volatile int', op '=' [124] */
26 	ptr = cviptr;
27 	/* expect+1: warning: illegal combination of 'pointer to const char' and 'pointer to const volatile int', op '=' [124] */
28 	cptr = cviptr;
29 	/* expect+1: warning: illegal combination of 'pointer to volatile char' and 'pointer to const volatile int', op '=' [124] */
30 	vptr = cviptr;
31 }
32