[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: C++ code indentation for GNU
From: |
Tom Tromey |
Subject: |
Re: C++ code indentation for GNU |
Date: |
Mon, 15 Jul 2019 12:44:38 -0600 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
Ian> When discussing formatting, we should keep the clang-format tool in mind
Ian> (https://clang.llvm.org/docs/ClangFormat.html). It's from the LLVM
Ian> project, and it's not under the GPL, but it is free software. We should
Ian> adopt a standard .clang-format file for GNU code. And, of course,
Ian> ideally someone would add the same functionality to GNU indent.
FWIW I looked at clang-format for gdb, but it wasn't suitable. In
particular the way it reformats arguments to function calls is very bad,
and I couldn't find a way to make it better. Here's an example bug:
https://bugs.llvm.org/show_bug.cgi?id=31907
I don't seem to have my .clang-format for gdb around any more.
I see gcc has one, but it also gives some sub-par results when run on
gdb.
It would be a big improvement if we could just use a tool. However GNU
indent is apparently not maintained, and clang-format isn't a good fit.
Tom