An abridged "Writing C" for the gcc web pages

Jeff Law law@redhat.com
Mon May 2 21:00:00 GMT 2016


On 05/02/2016 02:40 PM, Carlos O'Donell wrote:
>
> However, in the end, I think that yet-another-document is not the
> solution we want. What we actually need is a program that just formats
> your source according to the GNU Coding Style and that way you can always
> tell your users "Run indent" and be done with it. The output of such a
> program should always be considered correct, and if it's not, we should
> fix it immediately.
>
> Why can't we use indent?
Sadly, "indent" simply breaks c++ code.

I think the solution here is clang-format with a suitable clang-format 
configuration file.  One has been started (gcc/contrib/clang-format), 
but it's not yet complete.

>
> At the end of the day I never want to see another comment about code
> formatting because the user used X and X always formats code correctly.
Amen.

jeff



More information about the Gcc-patches mailing list