Re: automated coding style tool

Luis Machado via Gdb <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
On 1/14/25 17:11, Tom Tromey wrote:
>>>>>> Aktemur, Tankut Baris via Gdb <[email protected]> writes:
> 
>> Regarding the automated coding style tool: is there any active attempt
>> to pursue this goal?
> 
> Every year or two I take another look at clang-format.
> The discussion is here:
> 
> https://sourceware.org/bugzilla/show_bug.cgi?id=30098
> 
>> Tom mentioned his t/clang-format branch in that email thread.  I checked
>> the branch.  The clang-format config file has
>>   # BasedOnStyle:  GNU
>> Is the GDB coding style so off from the built-in GNU style
>> that it cannot be reused?
> 
> I don't recall why I commented this out.  Anyway clang-format doesn't
> come very close to GNU style.  I'd be ok with ignoring most of the
> little differences (i.e., I don't care about goto label placement), but
> the bin packing output is just super ugly some of the time.
> 
> Tom

I'd go for a tool, even if it is slightly to moderately different from what
we tend to use. It's not like the GNU style has been updated to cope with
the more recent C++ syntax, so we have some stuff that isn't properly
documented.

The tool would simplify that.

Also, the style of comment we use (/* */) doesn't go well with clang-format
from what I recall. But we can just drop options that deal with comments.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.