[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH 0/5] clang-format for Xen


  • To: Luca Fancellu <luca.fancellu@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 28 Jul 2023 12:12:29 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VjCOdF4UuGGVHSnxKV3WNPd+/ZOTM0K5Y8johWDgWYk=; b=d/70oCsC6qoeFRzeoneCHsNRI81l+WHyUg+umwAAQ+4fks2Hl4TabovgWDRXUWYYZjGcCMXYwi4Xd77wbNYhzgPjBAnywt2CFLQqvZ734wjWDOmmB5SHCT/QC/39i3pv2jfI+LoJagVo4zJJ35WR/naCC3tUDjj+D9DfK5kmzZ/GluYfSa1wURSYyfr2DS1dtQC/QAz3D7LjKulIHs8NjxCHgaVVjIqSKPx27+/s5ciOpt2HCytqIAygE3phOXEnjoMbUoMShC17rfBqpt6gWz3wFrRj1so+NQad12fQI1rnswC6iFIUFMNWqoQsw2EGtcJ1Eh3KJeivnm7ItUDaMQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dDL3dS/rQzLqaWpc78qrN0mwQJWH+22JAna42yn/sCoc+4T6cjDyL5BMwiwxsCESh8AiJp0TQGTZFexy3xzVYPmQk1CLpRwoZA18D+yxIuUO9LpumANz9Z6eW0e6Hal2MmARx7DpmpcN2c4rMMCtNMgXUWDRbrErgL9hTtFedSqoiLSBA6D7+nGhwJVP4JhUH/vdLGXlOsqzM5+tz592th32bJraqMoIRw10IjTvRxFLOBnDET341bu40k9Zf3qbFsEYTz/9bdSeeYc7PdSuLtMDxNr2TyvkrxYBtBwuQL9qo0aUpTY2X8EY8qI8GZvZXj8j/3YyqnPnLZIUUHbcYg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: bertrand.marquis@xxxxxxx, wei.chen@xxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 28 Jul 2023 10:12:53 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.