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 B8978A0A02; Wed, 24 Mar 2021 17:45:14 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 63AFD140F4C; Wed, 24 Mar 2021 17:45:14 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 14DA2140F3E for ; Wed, 24 Mar 2021 17:45:13 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 630132099911; Wed, 24 Mar 2021 09:45:12 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 630132099911 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1616604312; bh=oaGC7Ymu+91iG4wiJJe7x8ZheANg4hV0A5MmdbkJzhM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DTnAi999XZLm2ffslAVxVKkoD9ynb7dZ0lvpOaxeFm32zK5zmwHr1vx6P4Q4F7Abq T0Ehnucx7/CmFxIk6LrHvvELW3epCSypTwEFoCbYuHlup0p00KIQOvcbQ+oyKhFBn2 dsC2+Ih+Gpq6RuRzdoXiKCJ6JebgVd9Kc8TXOlOs= Date: Wed, 24 Mar 2021 09:45:12 -0700 From: Tyler Retzlaff To: Thomas Monjalon Cc: dev@dpdk.org, david.marchand@redhat.com, bruce.richardson@intel.com, stephen@networkplumber.org, drc@linux.vnet.ibm.com Message-ID: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8251456.Wk86ePSIJQ@thomas> User-Agent: Mutt/1.5.21 (2010-09-15) 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" 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 .