summaryrefslogtreecommitdiff
path: root/tests/usr.bin/xlint/lint1/msg_228.c
blob: ee525610456014cd58f7d00a501e717241ee983d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*	$NetBSD: msg_228.c,v 1.4 2023/07/07 19:45:22 rillig Exp $	*/
# 3 "msg_228.c"

/* Test for message: function cannot return const or volatile object [228] */

/* TODO: Also warn in C99 mode and later. */
/* lint1-flags: -sw -X 351 */

const int
return_const_int(void)
/* expect+1: warning: function cannot return const or volatile object [228] */
{
	return 3;
}

volatile int
return_volatile_int(void)
/* expect+1: warning: function cannot return const or volatile object [228] */
{
	return 3;
}