From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2316643B05; Sun, 18 Feb 2024 17:44:55 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 93E4C40262; Sun, 18 Feb 2024 17:44:54 +0100 (CET) Received: from wfout5-smtp.messagingengine.com (wfout5-smtp.messagingengine.com [64.147.123.148]) by mails.dpdk.org (Postfix) with ESMTP id E9C7F4021D for ; Sun, 18 Feb 2024 17:44:52 +0100 (CET) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfout.west.internal (Postfix) with ESMTP id 9B61A1C000A2; Sun, 18 Feb 2024 11:44:51 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sun, 18 Feb 2024 11:44:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1708274691; x=1708361091; bh=9+thLeMkA7pzkcEMUDWiXIFfNFQTRFP7HURsHiRRU40=; b= htb6GvBgnmRMymdlBxoBgLNBa9abhqBB0Y2MTV+5UZYNH0aAsxVPovh6p1ulvPLx U25+aI2Cjti454qlWMRza7WZAI/aMes+SHtCDmc+54nVKgS25jypda2VDTcpbi4b nvfTn5eCeK7miLvh3iFtOXEWQPbXHJjQLK9hFHvYh8yG8c0wgd32rnee6yp3qb7t Ew8udH/VXA69y2946jTsWOLGTOJCsC6V/Hli7mLxD8f7/4pJuP/qzhqwl6p9hnip PjfbqTHf2WrwBuC8S4J/BH9nlRvN6urb9nuHgjPGIfwrt1dZe9fiM8IFLiPT54vX X+LEOdN/cn2IjVZS4Wir5Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1708274691; x= 1708361091; bh=9+thLeMkA7pzkcEMUDWiXIFfNFQTRFP7HURsHiRRU40=; b=H VUpwXEl2VNLuBEUKskdOgGG+8hu+VtEHI6fk4yjl5wnFjYP8GL1KbdFzd85V6U0+ TV/1u6qTlHwV91umsP71NvzLac8LHKgA35YHTG5oM8G5+u9ZK8fQ+QEoJygfSbNP kzeozbCBAAzL/Nwn2PtgDzYgtRsefdNsvn/buK4CQMfxvaeKXQkRj9zPQSvNRFdF y8S6NkNwaJXRbqWP60bXBew2uEYqFBGvePdnz4fnpprZRU3NVnOlwzZU0aQrqyX5 DbisMoOHsAeXBXIs4+cL9M8Bo8B4LnAedQkXlHc+zGUuBCiIrXGaU9zYCmyUpplL sEHY77age6G2VAe9pdKtA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdeigdelgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkfgjfhgggfgtsehtqhertddttddunecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepgeejiedvleehudfhuefgfeevgfehieetgeeigffggfffffeiuefg ueektdeffeevnecuffhomhgrihhnpeguphgukhdrohhrghenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghlohhn rdhnvght X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 18 Feb 2024 11:44:50 -0500 (EST) From: Thomas Monjalon To: Morten =?ISO-8859-1?Q?Br=F8rup?= Cc: Tyler Retzlaff , dev@dpdk.org Subject: Re: [PATCH] eal: provide rte attribute macro for GCC attribute Date: Sun, 18 Feb 2024 17:44:48 +0100 Message-ID: <4204295.tIAgqjz4sF@thomas> In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9F22D@smartserver.smartshare.dk> References: <1708035618-14090-1-git-send-email-roretzla@linux.microsoft.com> <19936568.sWSEgdgrri@thomas> <98CBD80474FA8B44BF855DF32C47DC35E9F22D@smartserver.smartshare.dk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 18/02/2024 17:38, Morten Br=F8rup: > > From: Thomas Monjalon [mailto:thomas@monjalon.net] > > Sent: Sunday, 18 February 2024 16.35 > >=20 > > 18/02/2024 13:53, Morten Br=F8rup: > > > > From: Thomas Monjalon [mailto:thomas@monjalon.net] > > > > Sent: Sunday, 18 February 2024 13.24 > > > > > > > > 15/02/2024 23:20, Tyler Retzlaff: > > > > > Provide a new macro __rte_attribute(a) that when directly used > > > > > compiles to empty for MSVC and to __attribute__(a) when using > > > > GCC/LLVM. > > > > > > > > > > Replace direct use of __attribute__ in __rte_xxx macros where > > there > > > > is > > > > > existing empty expansion of the macro for MSVC allowing removal > > of > > > > > repeated #ifdef RTE_TOOLCHAIN_MSVC per macro to expand empty. > > > > > > > > I'm not sure it makes sense. > > > > I prefer seeing clearly what is empty with MSVC. > > > > > > This topic has previously been discussed in another context - adding > > external libraries [1]. > > > > > > Like you do here, I generally preferred #ifdefs in the code, but the > > majority preferred stubs "promoting improved code readability". > >=20 > > Stubs may make sense in many places, > > but here we are talking about rte_common.h > > where we abstract differences between arch and compilers, > > so it is the right place to be explicit with compilers support. >=20 > Very strong point. I'm convinced. >=20 > Should the new rte_attribute() macro still be introduced for other uses o= f __attribute__(), e.g. the somewhat exotic attributes in eal/include/rte_l= ock_annotations.h? They are all wrapped in a meaningful macro. > The not-so-exotic attributes could have new macros added, e.g. __rte_cons= t and __rte_pure. Yes we need wrappers for all attributes. > > > I might argue that Tyler is following that guidance here; and perhaps > > the decision should be reconsidered, now that we have a real-life > > example of how it affects code readability. ;-) > > > > > > [1]: https://inbox.dpdk.org/dev/20240109141009.497807-1- > > jerinj@marvell.com/