[clang-tools-extra] [clang-tidy] Only expand <inttypes.h> macros in modernize-use-std-format/print (PR #97911)

Mike Crowe via cfe-commits cfe-commits at lists.llvm.org
Sat Jul 6 13:32:35 PDT 2024


mikecrowe wrote:

I'm not particularly happy with the `FormatStringConverter` constructor now taking seven parameters. The risk of them getting muddled isn't huge though because they are all of different types. Should I perhaps put them all into the `FormatStringConverter::Configuration` struct or perhaps a separate struct in the absence of named parameters? Even if I leave them as seven parameters, is there a preferred order for them? Any recommendations gratefully received.

I considered adding a configuration option to list other macros that should be permitted in the format string. I will investigate doing so if this change is acceptable.

OpenBSD and mingw32 seem to just use `PRI` prefixes in their `inttypes.h`. I don't know whether Microsoft and MacOS do anything like glibc does which required the special `__PRI` handling.


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


More information about the cfe-commits mailing list