xref: /netbsd-src/tests/usr.bin/xlint/lint1/msg_307.c (revision e6298b924c5ba98f3a22919b56dab04a87cdbb1c)
1 /*	$NetBSD: msg_307.c,v 1.5 2023/07/07 19:45:22 rillig Exp $	*/
2 # 3 "msg_307.c"
3 
4 // Test for message: static variable '%s' set but not used [307]
5 
6 /* lint1-extra-flags: -X 351 */
7 
8 /* expect+1: warning: static variable 'set_but_not_used' set but not used [307] */
9 static int set_but_not_used;
10 
11 static int only_incremented;
12 
function(void)13 void function(void)
14 {
15 	set_but_not_used = 3;
16 	only_incremented++;
17 }
18