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 91B8AA0A02; Wed, 24 Mar 2021 18:04:14 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 28A2D140F59; Wed, 24 Mar 2021 18:04:14 +0100 (CET) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by mails.dpdk.org (Postfix) with ESMTP id DBA03140F58 for ; Wed, 24 Mar 2021 18:04:12 +0100 (CET) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 462645C013E; Wed, 24 Mar 2021 13:04:12 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Wed, 24 Mar 2021 13:04:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm3; bh= gupwn2nXMX2xnO1hwxjmn8jh4U8VK0ZNpqkVykAbZcg=; b=bYCst4tix65CeZvw SRjVAIQNiKfePVhNa21vD43aESTsAm0pY7mm7yuN+44kKcZNE1ZSTeXfcJ//DeQE NRncn/ZI5KuD+kPzZ8Dpt4Z2/2iZ1Js72UGauVWWKEllVeXQduDirEYZCRuVFhVg OAcx92a+ELcYRjCVXsG2bTWGlsgFM8e1lvd+FuKiCsLwfBGOBvBIB4goJ1nW3aLQ ZaGlcfFzNKYILnu+uxjcqMt+s5ekv/nbUgYsf3gFJ3JNijUfATc0+sHnufMvtYDM hYr1pedC0e9kgGJC5oYgWSF0Ebjx6uHtpIkcMr1gcMkn9rvi3rY+Vgs+SpGDhU9+ lh2R0Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=gupwn2nXMX2xnO1hwxjmn8jh4U8VK0ZNpqkVykAbZ cg=; b=ZvvgjHvsQDEvdA4/v2rT4S2vkc+ziMLpCJA/+6PmngvgKBuoesrOrGyeU TF+lR/PHbD/4D3iFZz5tN0qzpQ1jWaJUIXPokBkU0R9Wm6YJWV31BH2u4zBgIJAE 8XLKpNBnxlXmcS9M+fHarAi3NDNpfEzU9+UJ/qHt/2wal6tT+1naPnfR71qMj+Oy jjGIMMYYSVNMWWtaYOiaS9l9ulFzy7EPyBXXCatFtA+tq2vddk2+V0ppDC0BVPCk vDIaqedOgH4CybW7mVnLsyPnZwFn5gEqIPXwMAshrBpRpT+jO7EJMvlA5EZobS1o MXu2Q4tg/u2g0CyS11cghdF9gJpwA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudegkedgleegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkjghfggfgtgesthfure dttddtvdenucfhrhhomhepvfhhohhmrghsucfoohhnjhgrlhhonhcuoehthhhomhgrshes mhhonhhjrghlohhnrdhnvghtqeenucggtffrrghtthgvrhhnpedugefgvdefudfftdefge elgffhueekgfffhfeujedtteeutdejueeiiedvffegheenucfkphepjeejrddufeegrddv tdefrddukeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 0D25D1080063; Wed, 24 Mar 2021 13:04:09 -0400 (EDT) From: Thomas Monjalon To: Tyler Retzlaff Cc: dev@dpdk.org, david.marchand@redhat.com, bruce.richardson@intel.com, stephen@networkplumber.org, drc@linux.vnet.ibm.com Date: Wed, 24 Mar 2021 18:04:08 +0100 Message-ID: <6578330.zVv2phWGOd@thomas> In-Reply-To: <20210324164512.GB14991@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <1616560011-31647-1-git-send-email-roretzla@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> <8251456.Wk86ePSIJQ@thomas> <20210324164512.GB14991@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] eal: standard c++ forbids defining the keyword asm as a macro 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 Sender: "dev" 24/03/2021 17:45, Tyler Retzlaff: > On Wed, Mar 24, 2021 at 09:30:58AM +0100, Thomas Monjalon wrote: > > 24/03/2021 05:26, Tyler Retzlaff: > > > +#ifndef __cplusplus > > > #ifndef asm > > > #define asm __asm__ > > > #endif > > > +#endif > > > > It requires more explanations. > > Which compilers do not define asm? > > What happens with C++ if asm is undefined? > > i guess the subject line on my commit didn't communicate this properly > sorry. > > asm is a keyword in both the C and C++ standards. for C++ the keyword is > not permitted to be re-defined. > > here is the relevant text from the standard, in particular item (2). > > 17.6.4.3.1 Macro names [macro.names] > > 1 > A translation unit that includes a standard library header shall not > #define or #undef names declared in any standard library header. > > 2 > A translation unit shall not #define or #undef names lexically identical > to keywords, to the identifiers listed in Table 3, or to the attribute-tokens > described in 7.6. > > so when including rte_common.h into a translation unit that is being > compiled C++ the rte_common.h violates the standard by leaking the > #define asm macro. > > this problem appears as soon as you try to build a C++ based dpdk > application with clang using windows C++ runtime and #include . I understood this part. My question is more about the reason for having this define. I think it is there because some compilers don't have asm keyword, but have __asm__. And maybe that's the case for some C++ compilers. If I'm right, this patch is breaking compilation with some C++ compilers.