Hi,

Many GNU packages-if not all-use a macro #define _() as a shorthand for 
gettext() to support internationalization in a concise way. However, this 
convention is not currently documented in the GNU coding standards.

This omission causes issues with clang-format, which treats _() as a regular 
function call and consistently inserts a space between _ and ( during 
formatting. While minor, this behavior is inconvenient for projects following 
GNU conventions.

I've proposed a change to clang-format to allow customization of this behavior 
(discussion here). However, without a broader policy or documentation in the 
GNU coding style, the maintainers are hesitant to accept such a change. 
https://github.com/llvm/llvm-project/pull/159925#issuecomment-3322484612

As a contributor to GDB, I reached out to Simon Marchi, one of the maintainers, 
and he kindly updated the GDB coding standards to reflect this usage. I'm 
hoping this might help persuade the clang-format team. GDB coding style guide 
is here and includes said improvement: 
https://sourceware.org/gdb/wiki/Internals%20GDB-C-Coding-Standards

I'm writing to ask whether it would be possible to update the official GNU 
coding standards to include this convention. Having it documented would not 
only clarify the practice but also support tooling improvements across GNU 
projects.

Thank you for your consideration.

Best regards,
Klaus Gerlicher
Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Sean Fennelly, Jeffrey Schneiderman, Tiffany Doon Silva
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928


Reply via email to