[clang-tools-extra] [clang-tidy] Only expand <inttypes.h> macros in modernize-use-std-format/print (PR #97911)
Julian Schmidt via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 17 09:53:47 PDT 2024
================
@@ -34,13 +41,10 @@ The check doesn't do a bad job, but it's not perfect. In particular:
possible.
- At the point that the check runs, the AST contains a single
- ``StringLiteral`` for the format string and any macro expansion, token
- pasting, adjacent string literal concatenation and escaping has been
- handled. Although it's possible for the check to automatically put the
- escapes back, they may not be exactly as they were written (e.g.
- ``"\x0a"`` will become ``"\n"`` and ``"ab" "cd"`` will become
- ``"abcd"``.) This is helpful since it means that the ``PRIx`` macros from
- ``<inttypes.h>`` are removed correctly.
+ ``StringLiteral`` for the format string where escapes have been expanded.
+ The check tries to put the escapes back, they may not be exactly as they
----------------
5chmidti wrote:
Sounds a bit better to me: `The check tries to reconstruct escape sequences, but they may not be the same as written ...`
https://github.com/llvm/llvm-project/pull/97911
More information about the cfe-commits
mailing list