[cfe-dev] clang-format: setting to control spaces in C arrays?

Eli Bendersky eliben at google.com
Tue Jul 22 12:26:46 PDT 2014


On Tue, Jul 22, 2014 at 12:24 PM, Eli Bendersky <eliben at google.com> wrote:

>
>
>
> On Tue, Jul 22, 2014 at 12:16 PM, James Dennett <james.dennett at gmail.com>
> wrote:
>
>> On Tue, Jul 22, 2014 at 11:55 AM, Sean McBride <sean at rogue-research.com>
>> wrote:
>> > Hi all,
>> >
>> > Try as I may, I can't find if there is a setting to _stop_ clang-format
>> from changing this:
>> >
>> >         float pattern[] = {7.0f, 1.0f};
>> >
>> > into this:
>> >
>> >         float pattern[] = { 7.0f, 1.0f };
>> >
>> > Is there one?
>>
>> Yes... but I don't know which specific setting it is.  (In Google
>> style, clang-format will rewrite the latter to the former.)
>>
>
> Could this be Cpp11BracedListStyle ?
>
>
eliben at ebendersky: ~/llvm/llvm_svn_rw$ cat > foo.cpp
int arr = {7, 9};
eliben at ebendersky: ~/llvm/llvm_svn_rw$ $LLVMSVN/clang-format
-style="{Cpp11BracedListStyle: true}" foo.cpp
int arr = {7, 9};
eliben at ebendersky: ~/llvm/llvm_svn_rw$ $LLVMSVN/clang-format
-style="{Cpp11BracedListStyle: false}" foo.cpp
int arr = { 7, 9 };
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140722/1a1a29d4/attachment.html>


More information about the cfe-dev mailing list