<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Awesome - that patch fixed the problem
with alignment of the function declaration/definition parameter
list alignment, and also fixed my test case re erroneously putting
all of the parameters on a second line. Thank you for fixing this
so fast!<br>
<br>
The remaining issues from my original email are just us being a
bit fussy with our style, and we can live with changing that.<br>
<br>
Cheers,<br>
Graham St Jack<br>
<br>
<br>
On 27/11/15 08:00, Beren Minor wrote:<br>
</div>
<blockquote
cite="mid:CAONPvZx+R9McseCQuDF50BoOiftZ4XRTjyn0jit2XrceV+WaKw@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<div dir="ltr">I've updated <a moz-do-not-send="true"
href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D14325&d=CwMFaQ&c=8S5idjlO_n28Ko3lg6lskTMwneSC-WqZ5EBTEEvDlkg&r=yTQSm-kpxQWFmaw_dZw3NDIbiHmjByJUaCZAObR4cjk&m=4tfptidvCcBhCKrDu0JKjqk5Ueu40DPigZSDPNDj0bc&s=eip8U8rXUNwQqrsoS7Fuw1i12b3xIfx4ia2XvrdNq68&e=">http://reviews.llvm.org/D14325</a>
with a fix for the parameter declaration alignment issue.<br>
</div>
<div class="gmail_extra"><br clear="all">
<div>
<div class="gmail_signature">--<br>
Beren Minor</div>
</div>
<br>
<div class="gmail_quote">On Sun, Nov 22, 2015 at 11:43 PM,
Graham St Jack via cfe-dev <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:cfe-dev@lists.llvm.org" target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a></a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks for
the reply - my response is late too because I have been on
leave.<br>
<br>
On 19/11/15 05:21, via cfe-dev wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Message: 4<br>
Date: Wed, 18 Nov 2015 19:53:34 +0100<br>
From: Beren Minor via cfe-dev <<a
moz-do-not-send="true"
href="mailto:cfe-dev@lists.llvm.org" target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a></a>><br>
To: Daniel Jasper <<a moz-do-not-send="true"
href="mailto:djasper@google.com" target="_blank">djasper@google.com</a>><br>
Cc: <a moz-do-not-send="true"
href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>,
<a moz-do-not-send="true"
href="mailto:graham.stjack@quantum.com" target="_blank">graham.stjack@quantum.com</a><br>
Subject: Re: [cfe-dev] Question about clang-format<br>
Message-ID:<br>
<CAONPvZxsy4=S+Yaa3vxL6Gy983-BsTag4G2UBga9hc8c3CW8=<a
moz-do-not-send="true" href="mailto:Q@mail.gmail.com"
target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:Q@mail.gmail.com">Q@mail.gmail.com</a></a>><br>
Content-Type: text/plain; charset="utf-8"<span class=""><br>
<br>
Sorry for the late answer, the mail was lost in my
inbox.<br>
<br>
You're totally right about the pointer and reference
attachment rules, but<br>
currently the alignment code doesn't really handle it. I
don't think it<br>
would be very hard to implement, but I am wondering what
the expected<br>
alignment would be in the case of nested pointer / cv
qualifiers. I<br>
personally find such cases troublesome, and that is why
I usually attach<br>
the pointers and qualifiers to the type and not to the
variable.<br>
<br>
For example, where should the spaces be inserted in the
following case:<br>
<br>
const char* const* v1;<br>
float const* v2;<br>
SomeVeryLongType const& v3;<br>
</span></blockquote>
These use cases don't come up in our code base (we only care
about the constness of what is pointed/referred to, so the
question doesn't arise - but I see the problem.<br>
<br>
For us, what happens with cases like this are more
compelling:<br>
<br>
const char *v1, *v2, v3;<br>
<br>
Hence our interest in associating the pointer/reference with
the variable rather than the type - although I do admit that
we frown on declaring more than one variable per line.<span
class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Regarding the function parameter misalignment, this is
certainly a bug and<br>
you can file a bugreport about it if you like. I will
try to reproduce and<br>
fix it anyway.<br>
</blockquote>
<br>
</span>
I will leave it in your court, thanks. This is the one that
is the real blocker.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div class="h5">
Thanks,<br>
--<br>
Beren Minor<br>
<br>
On Fri, Nov 13, 2015 at 9:52 AM, Daniel Jasper <<a
moz-do-not-send="true"
href="mailto:djasper@google.com" target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:djasper@google.com">djasper@google.com</a></a>>
wrote:<br>
<br>
</div>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div class="h5">
Adding Beren, who has done the development here.<br>
<br>
<br>
On Fri, Nov 13, 2015 at 12:01 AM, Graham St Jack via
cfe-dev <<br>
<a moz-do-not-send="true"
href="mailto:cfe-dev@lists.llvm.org"
target="_blank">cfe-dev@lists.llvm.org</a>>
wrote:<br>
<br>
</div>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div class="h5">
Hi all,<br>
<br>
I am looking at using clang-format, and like
everyone else with a<br>
pre-existing quirky style, there are some things
that clang-format doesn't<br>
seem to handle for me.<br>
<br>
Most of the issues are minor - we can just
redefine our style, or they<br>
occur rarely enough for it not to matter.<br>
<br>
Some things that stand out as odd though (and make
adoption difficult)<br>
are the following blocks of code formatted with
this .clang-format file,<br>
using clang-format-3.8 built from trunk source
yesterday.<br>
<br>
BasedOnStyle: LLVM<br>
<br>
AlignConsecutiveAssignments:
true<br>
AlignConsecutiveDeclarations:
true<br>
AllowShortCaseLabelsOnASingleLine:
true<br>
AllowShortFunctionsOnASingleLine:
Inline<br>
BinPackParameters:
false<br>
BinPackArguments:
false<br>
BraceWrapping:<br>
IndentBraces: false<br>
AfterNamespace: false<br>
AfterClass: true<br>
AfterControlStatement: true<br>
AfterEnum: true<br>
AfterFunction: true<br>
AfterStruct: true<br>
AfterUnion: true<br>
BeforeCatch: true<br>
BeforeElse: true<br>
BreakBeforeBraces:
Custom<br>
ConstructorInitializerIndentWidth: 2<br>
ContinuationIndentWidth: 2<br>
ConstructorInitializerAllOnOneLineOrOnePerLine:
true<br>
MaxEmptyLinesToKeep: 1<br>
<br>
----------------------------------------<br>
<br>
int * err = 0;<br>
ino_t_xx dir_inode = 0;<br>
gen_t dir_gen = 0;<br>
<br>
Here, the variables and equal-signs are lined up
beautifully, but the<br>
star isn't hard up against 'err' - which I would
have expected given the<br>
fact that LLVM sets PointerAlignment to Right.
Looking into the<br>
implementation (and doing some experiments), it
looks like 'Right' just<br>
means "no need to put a space to the right of a
star" - but plenty of<br>
spaces can be inserted to align the variable. Is
this intentional, and if<br>
so, is there a plan to add a new option to align
pointers/references to the<br>
right (as distinct from not-left like now)?<br>
<br>
Since (regrettably) in C/C++, "pointerness" is
associated with the<br>
variable and not the type, having the star hard up
against the variable<br>
seems to me to be something that a lot of people
would want.<br>
<br>
<br>
----------------------------------------<br>
<br>
static int find_highest_index(ino_t base_inode,<br>
gen_t base_gen,<br>
int fd,<br>
uint32_t
*highest_index)<br>
<br>
This looks like a bug - if it aligns some of the
parameters, it should<br>
align all of them.<br>
<br>
----------------------------------------<br>
<br>
static int find_highest_index(<br>
ino_t base_inode, gen_t base_gen, int fd,
uint32_t *highest_index, bool<br>
dummy)<br>
<br>
This looks like a bug too - I added an extra
parameter with a short type<br>
to demonstrate that the first and last parameters
aren't aligned, but it<br>
put them all on one line. If there is an extra
configuration parameter that<br>
would prevent this, please let me know.<br>
<br>
----------------------------------------<br>
<br>
static int find_highest_index(ino_t base_inode,<br>
int fd,<br>
uint32_t
*highest_index,<br>
bool dummy)<br>
<br>
Here is the example that shows the first and last
parameter aren't<br>
aligned, but the others are.<br>
<br>
<br>
Thanks<br>
<br>
--<br>
Graham St Jack | Software Engineer | Quantum<br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a moz-do-not-send="true"
href="mailto:cfe-dev@lists.llvm.org"
target="_blank">cfe-dev@lists.llvm.org</a><br>
</div>
</div>
<a moz-do-not-send="true"
href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_cfe-2Ddev&d=CwIGaQ&c=8S5idjlO_n28Ko3lg6lskTMwneSC-WqZ5EBTEEvDlkg&r=yTQSm-kpxQWFmaw_dZw3NDIbiHmjByJUaCZAObR4cjk&m=txXwxkJVYrSF9OKwEB6ccTSxCsEMnoTxVYXq8gtPE-U&s=YcA6gd67WO2JnSODQdhhCsw1x2uZE7WalB25sZMMRr0&e="
rel="noreferrer" target="_blank">https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_cfe-2Ddev&d=CwIGaQ&c=8S5idjlO_n28Ko3lg6lskTMwneSC-WqZ5EBTEEvDlkg&r=yTQSm-kpxQWFmaw_dZw3NDIbiHmjByJUaCZAObR4cjk&m=txXwxkJVYrSF9OKwEB6ccTSxCsEMnoTxVYXq8gtPE-U&s=YcA6gd67WO2JnSODQdhhCsw1x2uZE7WalB25sZMMRr0&e=</a><br>
<br>
</blockquote>
<br>
</blockquote>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a moz-do-not-send="true"
href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_pipermail_cfe-2Ddev_attachments_20151118_545bc757_attachment.html&d=CwIGaQ&c=8S5idjlO_n28Ko3lg6lskTMwneSC-WqZ5EBTEEvDlkg&r=yTQSm-kpxQWFmaw_dZw3NDIbiHmjByJUaCZAObR4cjk&m=txXwxkJVYrSF9OKwEB6ccTSxCsEMnoTxVYXq8gtPE-U&s=ZTepWq0tjqTSgDGjP2RD5sf5MP_xviz8zdwI9db_jyI&e="
rel="noreferrer" target="_blank">https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_pipermail_cfe-2Ddev_attachments_20151118_545bc757_attachment.html&d=CwIGaQ&c=8S5idjlO_n28Ko3lg6lskTMwneSC-WqZ5EBTEEvDlkg&r=yTQSm-kpxQWFmaw_dZw3NDIbiHmjByJUaCZAObR4cjk&m=txXwxkJVYrSF9OKwEB6ccTSxCsEMnoTxVYXq8gtPE-U&s=ZTepWq0tjqTSgDGjP2RD5sf5MP_xviz8zdwI9db_jyI&e=</a>
><br>
<br>
------------------------------<br>
<br>
Subject: Digest Footer<span class=""><br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a moz-do-not-send="true"
href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
</span><a moz-do-not-send="true"
href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_cfe-2Ddev&d=CwIGaQ&c=8S5idjlO_n28Ko3lg6lskTMwneSC-WqZ5EBTEEvDlkg&r=yTQSm-kpxQWFmaw_dZw3NDIbiHmjByJUaCZAObR4cjk&m=txXwxkJVYrSF9OKwEB6ccTSxCsEMnoTxVYXq8gtPE-U&s=YcA6gd67WO2JnSODQdhhCsw1x2uZE7WalB25sZMMRr0&e="
rel="noreferrer" target="_blank">https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_cfe-2Ddev&d=CwIGaQ&c=8S5idjlO_n28Ko3lg6lskTMwneSC-WqZ5EBTEEvDlkg&r=yTQSm-kpxQWFmaw_dZw3NDIbiHmjByJUaCZAObR4cjk&m=txXwxkJVYrSF9OKwEB6ccTSxCsEMnoTxVYXq8gtPE-U&s=YcA6gd67WO2JnSODQdhhCsw1x2uZE7WalB25sZMMRr0&e=</a><br>
<br>
<br>
------------------------------<br>
<br>
End of cfe-dev Digest, Vol 101, Issue 110<br>
*****************************************<span
class="HOEnZb"><font color="#888888"><br>
</font></span></blockquote>
<span class="HOEnZb"><font color="#888888">
<br>
<br>
-- <br>
Graham St Jack | Software Engineer | Quantum | Office:
8304 8919 | Mobile: <a moz-do-not-send="true"
href="tel:0417%20281%20693" value="+33417281693"
target="_blank">0417 281 693</a></font></span>
<div class="HOEnZb">
<div class="h5"><br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a moz-do-not-send="true"
href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a moz-do-not-send="true"
href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_cfe-2Ddev&d=CwMFaQ&c=8S5idjlO_n28Ko3lg6lskTMwneSC-WqZ5EBTEEvDlkg&r=yTQSm-kpxQWFmaw_dZw3NDIbiHmjByJUaCZAObR4cjk&m=4tfptidvCcBhCKrDu0JKjqk5Ueu40DPigZSDPNDj0bc&s=iwxA5OA5U4rIXbXHUm7hR6wlvOVm5XSMT0AStCTH4BA&e="
rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Graham St Jack | Software Engineer | Quantum | Office: 8304 8919 | Mobile: 0417 281 693</pre>
</body>
</html>