WIP MachO binutils port assisted by AI I may consider upstreaming this in the future.
0

Configure Feed

Select the types of activity you want to include in your feed.

[contrib] Accept _("") and operator() in check_GNU_style_lib.py

Currently contrib/check_GNU_style_lib.py warns about '_("foo")', expecting
'_ ("foo")' instead:
...
$ cat tmp.patch
...
+const char *
+foo (void)
+{
+ return _("foo");
+}
$ ./contrib/check_GNU_style.py tmp.patch
=== ERROR type #1: there should be exactly one space between function name \
and parenthesis (1 error(s)) ===
test.c:4:10: return _("foo");
$
...

However '_("")' is an exception [1] to the rule, so skip the ERROR in this
case.

Likewise for 'operator()', which seems common enough:
...
$ find gdb* -type f \
| egrep -v '/testsuite/|ChangeLog' \
| xargs grep "::operator()" \
| wc -l
27
...
for example in gdb/dwarf2/read.c:
...
dwo_file_hash::operator() (const dwo_file_up &file) const noexcept
...

[1] https://sourceware.org/gdb/wiki/Internals%20GDB-C-Coding-Standards#Gettext_macro

Tom de Vries (Nov 20, 2025, 10:46 AM +0100) 4e1825f0 77f91fd4

+3 -1
+3 -1
contrib/check_GNU_style_lib.py
··· 164 164 class FunctionParenthesisCheck: 165 165 # TODO: filter out GTY stuff 166 166 def __init__(self): 167 - self.re = re.compile(r'\w(\s{2,})?(\()') 167 + self.re = re.compile(r'\w+(\s{2,})?(\()') 168 168 169 169 def check(self, filename, lineno, line): 170 170 if '#define' in line: ··· 172 172 173 173 m = self.re.search(line) 174 174 if m != None: 175 + if m.group() == '_(' or m.group() == 'operator(': 176 + return None 175 177 return CheckError(filename, lineno, 176 178 line[:m.start(2)] + error_string(m.group(2)) + line[m.end(2):], 177 179 'there should be exactly one space between function name ' \