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

// Test for message: function '%s' has 'return expr' and 'return' [216]

/* lint1-extra-flags: -X 351 */

/* expect+2: error: old-style declaration; add 'int' [1] */
random(int n)
{
	if (n < 0)
		return -3;
	if (n < 2)
		return;
}
/* expect-1: warning: function 'random' has 'return expr' and 'return' [216] */