From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id AD2C643AD8;
	Sun, 18 Feb 2024 16:34:40 +0100 (CET)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 3CCA34021D;
	Sun, 18 Feb 2024 16:34:40 +0100 (CET)
Received: from wfhigh4-smtp.messagingengine.com
 (wfhigh4-smtp.messagingengine.com [64.147.123.155])
 by mails.dpdk.org (Postfix) with ESMTP id E3532400D5
 for <dev@dpdk.org>; Sun, 18 Feb 2024 16:34:38 +0100 (CET)
Received: from compute4.internal (compute4.nyi.internal [10.202.2.44])
 by mailfhigh.west.internal (Postfix) with ESMTP id 7A3DA1800092;
 Sun, 18 Feb 2024 10:34:37 -0500 (EST)
Received: from mailfrontend2 ([10.202.2.163])
 by compute4.internal (MEProxy); Sun, 18 Feb 2024 10:34:37 -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=1708270477;
 x=1708356877; bh=ZK6aW+j5ToRCUPcgaSU/kDAO2O25Xcf7U2MABMYBcMU=; b=
 3H4s2W75O1IZ8af65l4UtqRhw37XK7vCnDLSsdsZLL9yDIqhL82YnH6uL8D6t5Ye
 DhO281wDp89++uE0JSmw69JUrNrzGTGH3VmejYYHQ0hwIRVgbbfqja2hzyNeGCaX
 rRcgBr7MxwzmNvz2h1ou3Jrhi1J1aoTo87VM/p0rpsLJDtZktPi2LVS0LrlrNC4l
 dClsLqYz74hFZVEHViZQ41BczrKTGHZN7Uk0+xmBh1P4/+V92Apzx8d34+UputE0
 GzOt9rkjhOTmgWcposYKYoOv2rj8Q44w7UXA9giW4vYBPnF4qPilG0t/5LjsnL4i
 j6oWCw3uRmKOMja1GjDyZA==
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=1708270477; x=
 1708356877; bh=ZK6aW+j5ToRCUPcgaSU/kDAO2O25Xcf7U2MABMYBcMU=; b=d
 FIjCMAU34kSvfcBlorHum0g82KSKfKVu3nlH0yjBadT+1pZCcGhAjWabcM8zi+eb
 M91nD4yMFZwLPmadLvM/sJHCRrl96fzW1u3cjJjZSMpAodYfo5tj/eJ3uo+P1JDh
 Q58smLhdsfbP5eUMo3u/P/Vo4zxWWMdT0MV8vrNNuH9pR4rNBEv1RWDuRjgMKSaA
 Myelcgubhghx8rUyffI50rOU9okEGR4vRVuUiPmbCQcZf6DdHWwVpRhrw++03QtU
 FylPkODxM22ZXkCt4VlZ3k73c7plemzl5BAo0/SXEZsEL6f8uOD7B8cRwZnzfgEZ
 CM/wLhQ0NKhH+CYjRIo2Q==
X-ME-Sender: <xms:jCPSZdRm3nbKybv76OT4cdhGCR0OOR2L4cKX5A4qBcUSijAS-GIk5A>
 <xme:jCPSZWxceljPnlnctDFypkwr9WlUjzSVFsADuF0c7wOCYNKo7wLoHKamyON4ayPpH
 4k-6Hrvd-4iMbXjZg>
X-ME-Received: <xmr:jCPSZS26Em7ZXZEGEgXpBLzuY6KUvk1Rzq_m4x7Wo4h8iVjAUclo4ImM5mGlkcO5js_VUPR2OIaWbcS8RJyNAlSj3Q>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdeigdektdcutefuodetggdotefrodftvf
 curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
 uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
 fjughrpefhvfevufffkfgjfhgggfgtsehtqhertddttddunecuhfhrohhmpefvhhhomhgr
 shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg
 ftrfgrthhtvghrnhepgeejiedvleehudfhuefgfeevgfehieetgeeigffggfffffeiuefg
 ueektdeffeevnecuffhomhgrihhnpeguphgukhdrohhrghenucevlhhushhtvghrufhiii
 gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghlohhn
 rdhnvght
X-ME-Proxy: <xmx:jCPSZVAfnZ3JN52DimPeNTG67P2w2SXhVNVc-u7EsbSP3FMdMssSsw>
 <xmx:jCPSZWj5C8D3hel5HtbxnnDysA6GW72VTB3iJBe-9mGWTy5Wi1nR6w>
 <xmx:jCPSZZo98yN_WPfT8eTGHsWfXduny16ZbHhqB7LiiwsZHAXrl489mw>
 <xmx:jSPSZXv8hygkOi5wOBHvxFsOQBZ8Pqxlu-izFi5HbEAH4zli57NCZX30woY>
Feedback-ID: i47234305:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun,
 18 Feb 2024 10:34:36 -0500 (EST)
From: Thomas Monjalon <thomas@monjalon.net>
To: Morten =?ISO-8859-1?Q?Br=F8rup?= <mb@smartsharesystems.com>
Cc: Tyler Retzlaff <roretzla@linux.microsoft.com>, dev@dpdk.org
Subject: Re: [PATCH] eal: provide rte attribute macro for GCC attribute
Date: Sun, 18 Feb 2024 16:34:35 +0100
Message-ID: <19936568.sWSEgdgrri@thomas>
In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9F22A@smartserver.smartshare.dk>
References: <1708035618-14090-1-git-send-email-roretzla@linux.microsoft.com>
 <3556729.8hb0ThOEGa@thomas>
 <98CBD80474FA8B44BF855DF32C47DC35E9F22A@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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

18/02/2024 13:53, Morten Br=F8rup:
> > From: Thomas Monjalon [mailto:thomas@monjalon.net]
> > Sent: Sunday, 18 February 2024 13.24
> >=20
> > 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.
> >=20
> > I'm not sure it makes sense.
> > I prefer seeing clearly what is empty with MSVC.
>=20
> This topic has previously been discussed in another context - adding exte=
rnal libraries [1].
>=20
> Like you do here, I generally preferred #ifdefs in the code, but the majo=
rity preferred stubs "promoting improved code readability".

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.

> 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 h=
ow it affects code readability. ;-)
>=20
> [1]: https://inbox.dpdk.org/dev/20240109141009.497807-1-jerinj@marvell.co=
m/