[cfe-dev] clang-format and PenaltyReturnTypeOnItsOwnLine?

Leif Hedstrom zwoop at apache.org
Fri Aug 16 14:54:22 PDT 2013


Hi all,

Hope this is the right channel for this question :). I'm looking at possibly using clang-format to clean up an indentation / formatting style mess for a fairly large project (Apache Traffic Server). One of our "quirks" is that we currently format our functions like:

inline const char*
some_func(int some_arg)
{
    …
}


I've tried both

	PenaltyReturnTypeOnItsOwnLine: 0

and

	PenaltyReturnTypeOnItsOwnLine: 10000


and various numbers in between, but it always formats the above like

inline const char* some_func(int some_arg)
{
  …
}


Maybe I'm misunderstanding what PenaltyReturnTypeOnItsOwnLine does? What's even more confusing is that if I use the "mozilla" predefined format, it still doesn't format it like I expect. And I'm 99% certain that Mozilla code also uses the "return type on its own line" formatting.

Cheers!

-- leif



More information about the cfe-dev mailing list