[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 21:15:42 PST 2026
s-barannikov wrote:
> > I made an assumption but never bothered to check with others: are we going to support multibyte encodings right away? I assumed not.
>
> We don't have a reliable way in the code currently to identify whether an encoding is multibyte or not. Such a mechanism would be needed to generate appropriate diagnostics if we were to limit support.
Unless I'm missing something, this PR assumes the execution encoding is single-byte. In particular, convertBasicCharacter takes single byte. (It returns single character, but that is fine, since all conversion specifiers are in the basic character set, and thus should be one-byte encodable.)
To make it support mutlibyte characters, we would need to know how to advance the format string iterator (read: determine multibyte character "length") when advancing through the format string. That's a big change...
https://github.com/llvm/llvm-project/pull/196568
More information about the llvm-branch-commits
mailing list