xref: /netbsd-src/tests/usr.bin/xlint/lint1/msg_216.c (revision e6298b924c5ba98f3a22919b56dab04a87cdbb1c)
1 /*	$NetBSD: msg_216.c,v 1.7 2023/07/07 19:45:22 rillig Exp $	*/
2 # 3 "msg_216.c"
3 
4 // Test for message: function '%s' has 'return expr' and 'return' [216]
5 
6 /* lint1-extra-flags: -X 351 */
7 
8 /* expect+2: error: old-style declaration; add 'int' [1] */
random(int n)9 random(int n)
10 {
11 	if (n < 0)
12 		return -3;
13 	if (n < 2)
14 		return;
15 }
16 /* expect-1: warning: function 'random' has 'return expr' and 'return' [216] */
17