Issue 127383
Summary [clang-format 21.0.0] There should be a way to handle long strings with printk
Labels clang-format
Assignees
Reporter andr2000
    Tested on/with:
1. clang-format 21.0.0git (https://github.com/llvm/llvm-project.git 82605285b8c6)
2. .clang-format used: https://github.com/andr2000/xen/blob/clang_cmnty_drivers_v001/xen/.clang-format
3. File in question: https://github.com/andr2000/xen/blob/clang_cmnty_drivers_v001/xen/drivers/acpi/tables.c

What I see:
```
@@ -629,12 +628,14 @@ acpi_parse_one_rmrr(struct acpi_dmar_header *header)
-           printk(XENLOG_ERR VTDPREFIX
- "Overlapping RMRRs [%"PRIx64",%"PRIx64"] and [%"PRIx64",%"PRIx64"]\n",
-                  rmrru->base_address, rmrru->end_address,
-                  base_addr, end_addr);
+ printk(XENLOG_ERR VTDPREFIX "Overlapping RMRRs [%" PRIx64
+ ",%" PRIx64 "] and [%" PRIx64
+ ",%" PRIx64 "]\n",
+ rmrru->base_address, rmrru->end_address, base_addr,
+ end_addr);
```
What is expected:
`printk format string left untouched
`

Linux and Xen both have in their coding style a requirement that the user visible
strings (e.g., printk() messages) should not be split so they can be searched
for more easily.

There is no way currently to set such a rule and define a list of functions
that should follow that, e.g. {printf|printk|some other function}.

_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to