[libc-commits] [libc] Add bit width length modifier to printf (PR #82461)

Michael Jones via libc-commits libc-commits at lists.llvm.org
Mon Mar 18 11:23:02 PDT 2024


michaelrj-google wrote:

Leaving uintmax_t as the max supported size is fine for now, in future I'd like to support uint128 but that will be in a followup patch. As for what to do when 999 is passed, that's up to you. The ideas I have are you could either mark the conversion as invalid (setting `has_conv` to false) or just clamp the value to whatever the size of uintmax_t is. The guidelines for deciding this the result of undefined behavior are here: https://libc.llvm.org/dev/undefined_behavior.html and whatever you decide you should document it here: https://libc.llvm.org/dev/printf_behavior.html

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


More information about the libc-commits mailing list