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

Re: [PATCH v1 5/5] CODING_STYLE: add .clang-format


  • To: Julien Grall <julien@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 1 Dec 2022 12:30:49 +0100
  • 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=wwb3uX4sUeJ5o8ahgE0HGFG8O33cOjJdcpKtqkABOTE=; b=VKAAs0GmnE9qwl5W9EYVniV5l9fbz1eurNGeUNG4IXadBTcx7RJ6CAjreZHkpckEqYpUzIYq08D/M9NcWs384zcnrYcB5ejNIC/Asfo5PeMhJipKIhTHCUEpxZxITd7VkHUuSo/hZe9fwXUyRIa4LMWa88PvX7vPAAXxQtaBSI+bMKQ80p+hRP7zjAWIHjdFTf+jRuIZ6vCvMYK8+gtsssuNO7O7atyMbsTTcXL9XVXRRNGq3k/4ARkayIecTWhtW0k2OeVVGmyviG5QdIwRnbD78j85EYz3wP8XYwl1VHB5hYordxTgrfrhHo/6PU9IcCw0MQARYhcHKwmLTBVqGQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Uh1tvMiCNVVKVTG9cfqTlLu+2NK7tVgJtAF1IY9Gmxj0CtD0pog3nGglTU+7cRHpFRsI+drGKBCMqLMJ9lnsJwc0L4HbHwnAL8hTi7CkTOvqKyiHDXP8KHxjfNTc/RAfLQ4/rT81G6MsUKdti8SypgAtn1pvi5kA+cGTwhuSUB2PbpyDJG0kxQ6BRaO3npkcpdsjnwRr9FGpc029zvRKL6i/0+zvb5QwPe+0zx7IpWHPNJB/YfZrnVzmjbVeff5VImbh3CcHgrRuD8w2qs2RFLipwLakQAoGDbOFNHZCXbA7ZgS6XbXhzszUWWpCqqTxwp7MrDj3Spm47mYEneNiIQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Christian Lindig <christian.lindig@xxxxxxxxxx>, David Scott <dave@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Edwin Torok <edvin.torok@xxxxxxxxxx>
  • Delivery-date: Thu, 01 Dec 2022 11:30:55 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 01.12.2022 11:47, Julien Grall wrote:
> 
> 
> On 01/12/2022 10:44, Juergen Gross wrote:
>> On 01.12.22 11:12, Julien Grall wrote:
>>>> We might want to add a comment to xs_wire.h like the one in ring.h in 
>>>> order to
>>>> document the requirement of the type definition of uint32_t.
>>>
>>> The problem with this approach is you made more difficult for any 
>>> userspace application to use the headers. So I would argue that the 
>>> Linux copy can remove "stdint.h" if needed.
>>
>> Today there is exactly one public header including stdint.h, and I'd argue
>> that this was a mistake.

I think so, too.

>> xs_wire.h is especially rather uninteresting for any user space application
>> but a Xenstore implementation. All consumers of xs_wire.h are probably
>> either in the Xen tree, or operating system kernels. User space 
>> applications
>> should use libxenstore for accessing the Xenstore, so I don't see an
>> advantage in breaking the usual philosophy of the Xen public headers NOT
>> including external headers like stdint.h.
> 
> I think Edwin example is a pretty good justification for including 
> stdint.h.

I disagree. The intention has always been for consumers to provide the
basic C99 types by whatever suitable means they have. Note that in Xen
we also have no stdint.h.

> If you have a coding style requiring to order header alphabetically, 
> then the developer may not even be able to include stdint.h without any 
> hackery (e.g. introducing a header that will always be before the Xen 
> public headers).

Just to indicate that commonly style requirements may be weaker than
"fully alphabetic" - we don't request full ordering. What we request is
that groups (xen/, asm/, public/) be ordered within any group, but we
do not (afaia) demand ordering across groups (and indeed commonly we
have asm/ after xen/).

Jan



 


Rackspace

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