1*465ab238Srillig /* $NetBSD: msg_362.c,v 1.4 2024/08/31 06:57:31 rillig Exp $ */ 238c0bdf2Srillig # 3 "msg_362.c" 338c0bdf2Srillig 464230f32Srillig // Test for message: conversion '%.*s' should not be escaped [362] 538c0bdf2Srillig 638c0bdf2Srillig /* 764230f32Srillig * Since the characters used for the conversion type were chosen to be easily 83d5fc263Srillig * readable, it doesn't make sense to obfuscate them. 938c0bdf2Srillig */ 1038c0bdf2Srillig 1138c0bdf2Srillig /* lint1-extra-flags: -X 351 */ 1238c0bdf2Srillig 1338c0bdf2Srillig typedef typeof(sizeof(0)) size_t; 1438c0bdf2Srillig typedef unsigned long long uint64_t; 1538c0bdf2Srillig 1638c0bdf2Srillig int snprintb(char *, size_t, const char *, uint64_t); 1738c0bdf2Srillig 1838c0bdf2Srillig void 1938c0bdf2Srillig example(unsigned u32) 2038c0bdf2Srillig { 2138c0bdf2Srillig char buf[64]; 2238c0bdf2Srillig 2364230f32Srillig /* expect+9: warning: conversion '\142' should not be escaped [362] */ 243d5fc263Srillig /* expect+8: warning: bit position 'o' in '\142old-style-lsb\0' should be escaped as octal or hex [369] */ 253d5fc263Srillig /* expect+7: warning: bit position 'o' (111) in '\142old-style-lsb\0' out of range 0..63 [371] */ 2664230f32Srillig /* expect+6: warning: unknown conversion '\001', must be one of 'bfF=:*' [374] */ 273d5fc263Srillig snprintb(buf, sizeof(buf), 283d5fc263Srillig "\177\020" 293d5fc263Srillig "\142old-style-lsb\0" 303d5fc263Srillig "\001old-style-lsb\0" 313d5fc263Srillig "\142\000old-style-lsb\0", 323d5fc263Srillig u32); 3338c0bdf2Srillig } 34