<div dir="ltr"><div dir="ltr">Hi Miguel,<div><br></div><div>Please see my answer here: <a href="https://stackoverflow.com/a/53112676/10594032">https://stackoverflow.com/a/53112676/10594032</a></div><div><br></div><div>Regards,</div><div>Owen</div></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Nov 1, 2018 at 11:28 AM Miguel Sánchez de León Peque via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I am using `clang-format` to automatically format all the C code I <br>
produce. Then, in my CI pipelines, I am executing Linux's <br>
`<a href="http://checkpatch.pl" rel="noreferrer" target="_blank">checkpatch.pl</a>`[0] script to verify the style matches the one expected <br>
by the Linux kernel style guide[1].<br>
<br>
Until very recently, that worked just fine, but I have now found a case <br>
were it does not.<br>
<br>
The question I have is better explained (and includes the required C <br>
source code) in Stack Overflow:<br>
<br>
<a href="https://stackoverflow.com/questions/53094436/" rel="noreferrer" target="_blank">https://stackoverflow.com/questions/53094436/</a><br>
<br>
Basically, I am initializing an array of structs and `clang-format` is <br>
breaking braces "{", but that is something `<a href="http://chekcpatch.pl" rel="noreferrer" target="_blank">chekcpatch.pl</a>` would not <br>
allow. I am unable to find a `clang-format` configuration that prevents <br>
those breaks before the braces.<br>
<br>
Thanks in advance for your help,<br>
<br>
Miguel<br>
<br>
[0]: <br>
<a href="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/scripts/checkpatch.pl" rel="noreferrer" target="_blank">https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/scripts/checkpatch.pl</a><br>
[1]: <a href="https://www.kernel.org/doc/html/v4.10/process/coding-style.html" rel="noreferrer" target="_blank">https://www.kernel.org/doc/html/v4.10/process/coding-style.html</a><br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>