Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D5A49C4708C for ; Thu, 1 Dec 2022 11:36:12 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.450587.707928 (Exim 4.92) (envelope-from ) id 1p0hrG-000762-TM; Thu, 01 Dec 2022 11:36:02 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 450587.707928; Thu, 01 Dec 2022 11:36:02 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1p0hrG-00075v-Pk; Thu, 01 Dec 2022 11:36:02 +0000 Received: by outflank-mailman (input) for mailman id 450587; Thu, 01 Dec 2022 11:36:01 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1p0hrF-00075p-Nc for xen-devel@lists.xenproject.org; Thu, 01 Dec 2022 11:36:01 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1p0hrE-00076S-VI; Thu, 01 Dec 2022 11:36:00 +0000 Received: from 54-240-197-233.amazon.com ([54.240.197.233] helo=[192.168.7.195]) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1p0hrE-0002iv-Nv; Thu, 01 Dec 2022 11:36:00 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID; bh=omB48ubW4YlcZj+BWbcqdf35/KunkQo5SvsP5leyPWc=; b=VmP+Bdg5/qP037ojkMeXl5wHBM Bb0RsRCXkCO1BtlCyVV6a3v2PN/5RtwPSoqt59Rsqx1d5H3ZcvEFORyQM+3QiaAQ0jYbTU72K7RX/ iRQIx0N0YEhMNJtiwSujQxxyJgFnoQp1LJVP6KXVkmypPEu5sfaAvV1LnbQzxoCsshdk=; Message-ID: Date: Thu, 1 Dec 2022 11:35:57 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [PATCH v1 5/5] CODING_STYLE: add .clang-format Content-Language: en-US To: Jan Beulich Cc: Xen-devel , Christian Lindig , David Scott , Wei Liu , Anthony Perard , Stefano Stabellini , Andrew Cooper , Bertrand Marquis , Juergen Gross , Edwin Torok References: <7e6b8e69-70d2-8178-205d-8c20b993162d@xen.org> <7DF6F06F-A65A-4F1F-8FDA-BF0E8977F99B@citrix.com> <99df302d-8bc5-55a7-a97e-dcc8eee41d2c@suse.com> <3e6e6948-7852-751e-a025-9fe36e9cfb82@xen.org> <82bdfded-6271-d262-136d-57b4b1a92a9b@suse.com> <6a5af398-270b-f57c-091c-78ebea8630ec@xen.org> <3eb81135-0cd5-1788-3569-0db7d68541b8@suse.com> From: Julien Grall In-Reply-To: <3eb81135-0cd5-1788-3569-0db7d68541b8@suse.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 01/12/2022 11:30, Jan Beulich wrote: > 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. I really dislike when I have to find the dependency of an header. This is really a waste of time... If other disagree with that, then the strict minimum would be for this dependency to be recorded if it hasn't been done (I couldn't find anywhere). > >> 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/). Right, but that's **our** coding style. You don't know what's going to be the coding style for other project. Cheers, -- Julien Grall