================ @@ -44,15 +44,18 @@ void test_os_log_format(const char *pc, int i, void *p, void *buf) { } // Test os_log_format primitive with ObjC string literal format argument. -void test_objc(const char *pc, int i, void *p, void *buf, NSString *nss) { +void test_objc(const char *pc, int i, void *p, void *buf, NSString *nss, id obj) { __builtin_os_log_format(buf, @""); __builtin_os_log_format(buf, @"%d"); // expected-warning {{more '%' conversions than data arguments}} __builtin_os_log_format(buf, @"%d", i); + __builtin_os_log_format(buf, @"%P", p); // expected-warning {{using '%P' format specifier without precision}} __builtin_os_log_format(buf, @"%.10P", p); __builtin_os_log_format(buf, @"%.*P", p); // expected-warning {{field precision should have type 'int', but argument has type 'void *'}} __builtin_os_log_format(buf, @"%.*P", i, p); __builtin_os_log_format(buf, @"%.*P", i, i); // expected-warning {{format specifies type 'void *' but the argument has type 'int'}} + __builtin_os_log_format(buf, @"%.8P", nss); // expected-warning {{using '%P' format specifier with an Objective-C pointer results in dumping runtime object structure, not object value}} ---------------- ahatanak wrote:
Yes, that makes sense. https://github.com/llvm/llvm-project/pull/89977 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits