clang-format: setting to control spaces in C arrays?

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?

Thanks,

Yes... but I don't know which specific setting it is. (In Google
style, clang-format will rewrite the latter to the former.)

-- James

Could this be Cpp11BracedListStyle ?

Eli

The setting is Cpp11BracedListStyle.

Not the best or most discoverable name, but that is for historic reasons.

Cheers,
Daniel

eliben@ebendersky: ~/llvm/llvm_svn_rw$ cat > foo.cpp
int arr = {7, 9};
eliben@ebendersky: ~/llvm/llvm_svn_rw$ $LLVMSVN/clang-format
-style="{Cpp11BracedListStyle: true}" foo.cpp
int arr = {7, 9};
eliben@ebendersky: ~/llvm/llvm_svn_rw$ $LLVMSVN/clang-format
-style="{Cpp11BracedListStyle: false}" foo.cpp
int arr = { 7, 9 };

The setting is Cpp11BracedListStyle.

Confirmed, thanks to all for your replies.

Not the best or most discoverable name, but that is for historic reasons.

As I'm doing C, I admit I sorta dismissed that one as irrelevant. :slight_smile:

Cheers,