1 /* $NetBSD: msg_365.c,v 1.4 2024/08/31 06:57:31 rillig Exp $ */ 2 # 3 "msg_365.c" 3 4 // Test for message: missing field width after '%.*s' [365] 5 6 /* 7 * The conversions 'f' and 'F' require a field width as their second argument. 8 */ 9 10 /* lint1-extra-flags: -X 351 */ 11 12 typedef typeof(sizeof(0)) size_t; 13 typedef unsigned long long uint64_t; 14 15 int snprintb(char *, size_t, const char *, uint64_t); 16 17 void 18 example(unsigned u32) 19 { 20 char buf[64]; 21 22 /* expect+4: warning: missing field width after 'f\000' [365] */ 23 snprintb(buf, sizeof(buf), 24 "\177\020" 25 "f\000", 26 u32); 27 28 /* expect+5: warning: empty description in 'f\007\010' [367] */ 29 /* expect+4: warning: missing '\0' at the end of 'f\007\010' [366] */ 30 snprintb(buf, sizeof(buf), 31 "\177\020" 32 "f\007\010", 33 u32); 34 } 35