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 A3E40A0A02; Sat, 17 Apr 2021 03:17:59 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AB8ED161DE9; Sat, 17 Apr 2021 03:16:07 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 6B97440143 for ; Sat, 17 Apr 2021 03:16:06 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id 866B720B8001; Fri, 16 Apr 2021 18:16:05 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 866B720B8001 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1618622165; bh=neOS7Fa6svRa8BkApXqc9iE4NRqc6jyLgN9XoCryWRs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WZ42dQKx4cn3NjuUvpoeaIdu+R8vxdYSROklv/bCTqstIfLvCzV0wn7SZmCzppEFx vHusTYgweS2vgNJBwimv5whUsuotCJWATq16twS/rN+8tuySPYbXXhhGk0sNQaxYZc bfilSMiTeK8e/76ooab6f1XY0v/uNsgB5TlYCKeE= Date: Fri, 16 Apr 2021 18:16:05 -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: <20210417011605.GA13677@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <1616560011-31647-1-git-send-email-roretzla@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> <3365684.9AJlD7vKmA@thomas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3365684.9AJlD7vKmA@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 Tue, Apr 13, 2021 at 03:35:53PM +0200, Thomas Monjalon wrote: > 24/03/2021 05:26, Tyler Retzlaff: > > --- a/lib/librte_eal/include/rte_common.h > > +++ b/lib/librte_eal/include/rte_common.h > > @@ -31,9 +31,11 @@ extern "C" { > > #define typeof __typeof__ > > #endif > > > > +#ifndef __cplusplus > > #ifndef asm > > #define asm __asm__ > > #endif > > +#endif > > Applied with this explanation: > > eal: do not redefine asm keyword in C++ > > C++ forbids redefining a keyword as a macro. > The keyword asm is conditionally-supported and implementation defined, > but it seems our best guess. > > In C, if asm does not exist, it is defined as __asm__ > which is a GNU extension. > > > One more question: > Can we have a similar issue with typeof? > I guess it works because typeof is not a keyword? typeof isn't a keyword though don't fully understand the benefit of #define typeof __typeof__ since it just pollutes the application namespace. extensions and intrinsics generally should stay in the namespace reserved for use by the compiler `__'. i would say we will have a similar issue with any keyword defined in the c++ standard if we are defining any of them.