[cfe-dev] clang-format inconsistent behavior

Manuel Klimek via cfe-dev cfe-dev at lists.llvm.org
Wed Feb 15 01:12:01 PST 2017


On Wed, Feb 15, 2017 at 10:02 AM FIXED-TERM Kammel Fabian (ETAS-PSC/EPE) <
fixed-term.Fabian.Kammel at escrypt.com> wrote:

> No sorry the error is on my side. I accidentally copied the same file
> twice. Find the correct files attached to this mail.
>
>
>
> I do agree that the interface to the function calls can be improved, but
> (as you probably know) that is not always possible. I do have two weeks of
> spare time. Do you think it’s reasonable to implement a switch to specify
> this behavior as well?
>
>
>
> Also do you think it’s possible to achieve this in two weeks? Sounds like
> this change/adding this option might be complex or even impossible?
>

I don't think two weeks will be enough to come up with a solution that gets
consensus; if not due to the work required, the latency alone will prevent
this (I'd expect this to go through multiple possible architectural
revisions)


>
>
> Regards,
>
> Fabian
>
>
>
>
>
> *From:* Manuel Klimek [mailto:klimek at google.com]
> *Sent:* Dienstag, 14. Februar 2017 12:24
> *To:* FIXED-TERM Kammel Fabian (ETAS-PSC/EPE) <
> fixed-term.Fabian.Kammel at escrypt.com>; cfe-dev at lists.llvm.org
> *Subject:* Re: [cfe-dev] clang-format inconsistent behavior
>
>
>
> Not sure whether I'm unable to use my mail program correctly, but I don't
> get a diff between desired.c and format_me.c.
>
>
>
> Generally, we've thought about trying to make clang-format be more
> consistent across subsequent statements, but
>
> a) that's a lot of effort, as clang-format fundamentally works on each
> statement separately
>
> b) basically all instances (outside of braced lists, which have special
> support) we've seen have been due to code duplication, where the right
> answer is to refactor the code so the structure is simpler
>
>
>
> For example, in your code, I would pull out a wrapper function that takes
> all the common parameters in a struct, and potentially the other parameters
> as structs, too. That way, the calls would become reasonably short.
>
>
>
> On Mon, Feb 13, 2017 at 5:35 PM FIXED-TERM Kammel Fabian (ETAS-PSC/EPE)
> via cfe-dev <cfe-dev at lists.llvm.org> wrote:
>
> Hi All,
>
>
>
> I have found an inconsistent behavior in clang-format. When I format the
> attached desired.c with the attached .clang-format file (using Clang 4.0 on
> Windows) I get format_me.c.
>
>
>
> I think that the assignment should be consistent, either break the line
> for all assignments or none of them. Is there an option I have missed or is
> this behavior intended/not configurable? And if not configurable would we
> be interested in such a switch?
>
>
>
> Regards,
>
> Fabian
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170215/253d1c92/attachment.html>


More information about the cfe-dev mailing list