Re: GNU style checker for GDB

David Blaikie via Gdb
2021-03-08T22:39:46Z

On Mon, Mar 8, 2021 at 2:31 PM Simon Marchi <simon.marchi@polymtl.ca> wrote:

> On 2021-03-08 3:39 p.m., David Blaikie wrote:
> > If anyone's interested in investing some time in it, I expect
> clang-format would be open to bugs/patches to support whatever formatting
> idioms gdb needs.
>
> That's one of those things I'd really like to try, but will never have
> time. But I can at least file some bugs.
>
> What stopped me from doing so in the past is that the missing things
> were really some things I would consider like oddities / inconsistency
> of our style. For example, we use space before parenthesis, except for
> the `_` (gettext) macro:
>
> printf (_("Hello %s\n"), name);
>
> If we tell clang-format we want spaces before function call parenthesis,
> it (rightfully) inserts a space after the `_`. To prevent that, I
> suppose we'd need a way to say: in general I want this style, but for
> this macro I want this other style. I fear I'll be called crazy if I
> request that :).
>

I think if you can point to a widely used style (the gdb (& binutils more
generally?) codebase) there's probably going to be a fair bit of
sympathy/understanding there.