xref: /netbsd-src/tests/usr.bin/xlint/lint1/msg_359.c (revision 0a3071956a3a9fdebdbf7f338cf2d439b45fc728)
1 /*	$NetBSD: msg_359.c,v 1.1 2024/03/01 19:39:28 rillig Exp $	*/
2 # 3 "msg_359.c"
3 
4 // Test for message: missing new-style '\177' or old-style number base [359]
5 
6 /*
7  * The first or second character of the snprintb format specifies the number
8  * base.  It must be given in binary.
9  */
10 
11 /* lint1-extra-flags: -X 351 */
12 
13 typedef typeof(sizeof(0)) size_t;
14 typedef unsigned long long uint64_t;
15 
16 int snprintb(char*, size_t, const char*, uint64_t);
17 
18 void
19 old_style_number_base(void)
20 {
21 	char buf[64];
22 
23 	/* expect+1: warning: missing new-style '\177' or old-style number base [359] */
24 	snprintb(buf, sizeof(buf), "", 0);
25 	snprintb(buf, sizeof(buf), "\010", 0);
26 	snprintb(buf, sizeof(buf), "" "\177\020" "", 0);
27 }
28