[libc-commits] [clang] [libc] [libc] Fix modular printf attributes (PR #194003)

Volodymyr Turanskyy via libc-commits libc-commits at lists.llvm.org
Thu May 7 03:53:49 PDT 2026


voltur01 wrote:

Hi, digging into this a bit more, it looks like handling of builtins is different in C and C++ mode: in C mode attributes are initialized earlier and are available for the validation, while in C++ this is skipped, so that the format attribute is only added after the validation.

I removed the hardcoded attributes from this patch and added my local fix as a demonstration - it extends the validation logic to expect that builtins and the special asprintf-like functions will get the attribute eventually.

Other ways to fix would be to move validation or addition of implicit attributes around, which is a bigger structural change.

Please let me know what you think, thanks!

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


More information about the libc-commits mailing list