msg_386.c revision 1.1 1 /* $NetBSD: msg_386.c,v 1.1 2025/08/31 20:43:27 rillig Exp $ */
2 # 3 "msg_386.c"
3
4 // Test for message: conversion '%.*s' does not mix with '%c' [386]
5
6 /*
7 * In the snprintb format string, the conversions 'f' and '=' mix well, and so
8 * do 'F' and ':'. But 'f' doesn't mix with ':', and neither does 'F' mix with
9 * '='.
10 */
11
12 /* lint1-extra-flags: -X 351 */
13
14 typedef typeof(sizeof 0) size_t;
15
16 void snprintb(char *, size_t, const char *, unsigned long long);
17
18 void
19 test_snprintb(void)
20 {
21 char buf[50];
22
23 snprintb(buf, sizeof buf,
24 "\177\020"
25 "f\000\020" "field\0"
26 "" "=\000" "mix\0"
27 "" ":\001" "no-mix\0"
28 "F\020\020" "field\0"
29 "" "=\000" "no-mix\0"
30 "" ":\000" "mix\0",
31 /* expect+2: warning: conversion ':' does not mix with 'f' [386] */
32 /* expect+1: warning: conversion '=' does not mix with 'F' [386] */
33 0xffffffff);
34 }
35