xref: /netbsd-src/tests/usr.bin/xlint/lint1/msg_228.c (revision 7d62b00eb9ad855ffcd7da46b41e23feb5476fac)
1 /*	$NetBSD: msg_228.c,v 1.3 2022/06/16 21:24:41 rillig Exp $	*/
2 # 3 "msg_228.c"
3 
4 /* Test for message: function cannot return const or volatile object [228] */
5 
6 /* TODO: Also warn in C99 mode and later. */
7 /* lint1-flags: -sw */
8 
9 const int
10 return_const_int(void)
11 /* expect+1: warning: function cannot return const or volatile object [228] */
12 {
13 	return 3;
14 }
15 
16 volatile int
17 return_volatile_int(void)
18 /* expect+1: warning: function cannot return const or volatile object [228] */
19 {
20 	return 3;
21 }
22