xref: /netbsd-src/tests/usr.bin/xlint/lint1/msg_228.c (revision e6298b924c5ba98f3a22919b56dab04a87cdbb1c)
1 /*	$NetBSD: msg_228.c,v 1.4 2023/07/07 19:45:22 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 -X 351 */
8 
9 const int
return_const_int(void)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
return_volatile_int(void)17 return_volatile_int(void)
18 /* expect+1: warning: function cannot return const or volatile object [228] */
19 {
20 	return 3;
21 }
22