<div dir="ltr">Yes, clang-format currently does not have an option that says "always break after a function's return type". It should be fairly easy to add, though. Does your coding style prescribe this for definitions only or also for declarations?</div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Aug 17, 2013 at 10:33 AM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><p dir="ltr"><br>
On Aug 16, 2013 9:31 PM, "Leif Hedstrom" <<a href="mailto:zwoop@apache.org" target="_blank">zwoop@apache.org</a>> wrote:<br>
><br>
> Hi all,<br>
><br>
> 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:<br>
><br>
> inline const char*<br>
> some_func(int some_arg)<br>
> {<br>
> …<br>
> }<br>
><br>
><br>
> I've tried both<br>
><br>
> PenaltyReturnTypeOnItsOwnLine: 0<br>
><br>
> and<br>
><br>
> PenaltyReturnTypeOnItsOwnLine: 10000<br>
><br>
><br>
> and various numbers in between, but it always formats the above like<br>
><br>
> inline const char* some_func(int some_arg)<br>
> {<br>
> …<br>
> }<br>
><br>
><br>
> Maybe I'm misunderstanding what PenaltyReturnTypeOnItsOwnLine does? </p>
</div><p dir="ltr">I assume it identifies the 'cost of splitting a line after the return. Relative costs of different splits are used in comparisons to decide on the optimal split - I doubt it'll change anything related to the behavior of the unsplit lines.</p>
<div class="HOEnZb"><div class="h5">
<p dir="ltr">> 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.<br>
><br>
> Cheers!<br>
><br>
> -- leif<br>
> _______________________________________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</p>
</div></div><br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>