On 28.07.2023 10:11, Luca Fancellu wrote:
> I've read the past threads about the brave people who dared to try to 
> introduce
> clang-format for the xen codebase, some of them from 5 years ago, two points
> were clear: 1) goto label needs to be indented and 2) do-while loops have the
> braket in the same line.
> While point 1) was quite a blocker, it seemd to me that point 2) was less
> controversial to be changed in the Xen codestyle, so the current wrapper 
> script
> handles only the point 1 (which is easy), the point 2 can be more tricky to
> handle.

I'm afraid I view the do/while part pretty much as a blocker as well.
While placing the opening brace according to our style elsewhere would
be okay-ish (just a little wasteful to have two almost empty lines),
having the closing brace on a separate line is problematic: At least I
consider a block / scope to end at the line where the closing brace is.
So the farther do and while are apart, the more

    do
    {
        ...;
    }
    while ( cond );
    ...;

is going to be misleading. While normally we would write potentially
conflicting constructs this way

    while ( cond )
        ;

the alternative spelling still isn't outright wrong in our style (I
believe):

    while ( cond );

Jan

Reply via email to