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 1F83E43B57;
	Tue, 20 Feb 2024 19:06:31 +0100 (CET)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 0BF4C402A7;
	Tue, 20 Feb 2024 19:06:31 +0100 (CET)
Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182])
 by mails.dpdk.org (Postfix) with ESMTP id 198DA40289
 for <dev@dpdk.org>; Tue, 20 Feb 2024 19:06:30 +0100 (CET)
Received: by linux.microsoft.com (Postfix, from userid 1086)
 id 453A42083618; Tue, 20 Feb 2024 10:06:29 -0800 (PST)
DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 453A42083618
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;
 s=default; t=1708452389;
 bh=mr65XyqzReutVERWpatYVQTtw5aRuhu0poA72Eo7PtQ=;
 h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
 b=XlyKoByv+r/tajyUHo5ahaRG/o4P5pWv403hFWDLjvL1OhgAx42haOUb6uz16i+EQ
 tzAz7iP2+wbRrnjAuw/Ji+X48SrotTsaqRaDQAuZokRYJi74SQ18Ae10rCe25npnOs
 hk+VTBnsir7n2GjxJJc/1/kk2dV+hAL9VZO+LD1I=
Date: Tue, 20 Feb 2024 10:06:29 -0800
From: Tyler Retzlaff <roretzla@linux.microsoft.com>
To: Thomas Monjalon <thomas@monjalon.net>
Cc: Mattias =?iso-8859-1?Q?R=F6nnblom?= <hofors@lysator.liu.se>, dev@dpdk.org
Subject: Re: [PATCH] eal: provide rte attribute macro for GCC attribute
Message-ID: <20240220180629.GB19214@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net>
References: <1708035618-14090-1-git-send-email-roretzla@linux.microsoft.com>
 <3556729.8hb0ThOEGa@thomas>
 <3838403f-af2e-4a2c-b06a-ec4db956d410@lysator.liu.se>
 <3474620.eGJsNajkDb@thomas>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <3474620.eGJsNajkDb@thomas>
User-Agent: Mutt/1.5.21 (2010-09-15)
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

On Sun, Feb 18, 2024 at 04:31:50PM +0100, Thomas Monjalon wrote:
> 18/02/2024 15:51, Mattias Rönnblom:
> > On 2024-02-18 13:24, Thomas Monjalon wrote:
> > > 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.
> > 
> > Anything __rte_attribute() is empty on MSVC. You could rename it 
> > __rte_attribute_ignored_by_msvc() for clarity.
> 
> Yes it would bring more clarity.
> But I still prefer #ifdef which may work with more compilers.
> 
> > One could note that on the ignore list are things like "may_alias" and 
> > "packed", so whatever comes out of a MSVC build should not be expected 
> > to actually work.
> > 
> > Unless I'm missing something, for all the attributes that will have 
> > MSVC-propriety equivalent, the usage pattern would have to change, since 
> > the syntax is different in incompatible ways.
> > 
> > Wouldn't it be better to ask the MSVC team to add support GCC 
> > attributes? ICC and LLVM managed, so why not Microsoft. Then you would 
> > solve this issue for all Open Source projects, not only DPDK.
> 
> We can expect MSVC to improve.
> That's another reason why I prefer to keep #ifdef to keep track easily.

MSVC is committed to provide functionality where something simply cannot
be done at all with their toolset and standard C. They will not make
changes to their toolset for functionality they already have.