[llvm-branch-commits] [clang] [clang-tools-extra] [llvm] Add format string handling (PR #196568)

Sergei Barannikov via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sat Nov 14 19:07:31 PST 2026


================
@@ -117,13 +124,17 @@ ParsePrintfSpecifier(FormatStringHandler &H, const char *&Beg, const char *E,
     return true;
   }
 
-  if (*I == '{') {
+  if (FormatStrConverter.convertBasicChar(*I) == u8'{') {
     ++I;
     unsigned char PrivacyFlags = 0;
     StringRef MatchedStr;
 
     do {
-      StringRef Str(I, E - I);
+      const char *II;
+      std::string S(I, E - I);
+      for (unsigned long i = 0; i < S.length(); ++i)
----------------
s-barannikov wrote:

(nit) Never use `long` type, its size is non-portable across platforms.

```suggestion
      for (size_t i = 0; i < S.length(); ++i)
```

https://github.com/llvm/llvm-project/pull/196568


More information about the llvm-branch-commits mailing list