You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[clang-format] Add SpaceBetweenUnderscoreParens option for GNU gettext macro
This adds a new configuration option SpaceBetweenUnderscoreParens to control
spacing between underscore and opening parenthesis. This is specifically
designed for the gettext internationalization macro '_()' commonly used in
GNU projects like GDB.
The option:
- Defaults to true for LLVM style (preserving existing behavior)
- Defaults to false for GNU style (removes space before '_(')
- Only affects single underscore tokens '_', not other identifiers
- Leaves all other spacing rules unchanged
Examples:
GNU style with SpaceBetweenUnderscoreParens=false:
printf(_("Hello")); // No space before '_('
my_func (arg); // Space before other functions preserved
LLVM style with SpaceBetweenUnderscoreParens=true:
printf(_ ("Hello")); // Standard spacing rules apply
This addresses the common pattern in GNU software where gettext messages
use '_()' without spaces, improving consistency with GNU coding standards.
0 commit comments