xref: /netbsd-src/tests/usr.bin/xlint/lint1/msg_359.c (revision b2c35e17b976cf7ccd7250c86c6f5e95090ed636)
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