[cfe-dev] clang-format: features, questions and contributions

Csaba Raduly via cfe-dev cfe-dev at lists.llvm.org
Thu Sep 27 08:16:46 PDT 2018


Hi Alan,

On Thu, Sep 27, 2018 at 9:36 AM, Alan Oursland via cfe-dev
<cfe-dev at lists.llvm.org> wrote:
(snip)
> Having different rules for C and C++... I have no idea how I'd distinguish
> that programmatically.
>
> Can clang-format tell if a file is C or C++? If so, adding a new FormatStyle
> so I can have different configs in my .clang-format file doesn't seem too
> difficult on the surface.

It seems easier to filter the list of files, and invoke clang-format
once for C files with one config and again for C++ files with a
different config file.


Csaba
-- 
You can get very substantial performance improvements
by not doing the right thing. - Scott Meyers, An Effective C++11/14 Sampler
So if you're looking for a completely portable, 100% standards-conformat way
to get the wrong information: this is what you want. - Scott Meyers (C++TDaWYK)



More information about the cfe-dev mailing list