DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Thomas Monjalon <thomas@monjalon.net>
Cc: Tyler Retzlaff <roretzla@linux.microsoft.com>,
	dev@dpdk.org, david.marchand@redhat.com,
	bruce.richardson@intel.com, drc@linux.vnet.ibm.com
Subject: Re: [dpdk-dev] [PATCH] eal: standard c++ forbids defining the keyword asm as a macro
Date: Wed, 24 Mar 2021 12:52:28 -0700	[thread overview]
Message-ID: <20210324125228.5dca333a@hermes.local> (raw)
In-Reply-To: <11634428.8dEGKDZn2b@thomas>

On Wed, 24 Mar 2021 18:52:40 +0100
Thomas Monjalon <thomas@monjalon.net> wrote:

> 24/03/2021 18:28, Tyler Retzlaff:
> > On Wed, Mar 24, 2021 at 06:04:08PM +0100, Thomas Monjalon wrote:  
> > > 24/03/2021 17:45, Tyler Retzlaff:
> > > 
> > > 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.  
> > 
> > so to qualify. you mean maybe it is breaking compilation of c++ in a
> > compiler that explicitly violates c++ standard when compiling c++? that
> > would mean it is not a c++ compiler.  
> 
> The asm keyword is part of all C++ standards?
> It seems asm is non-standard in C,
> that's why we use __asm__.
> 
> > in general i don't think it is a good practice to have dpdk introduce
> > names into the application namespace unqualified, but the point you make
> > is valid it can break c++ compilation if something was using this macro
> > as a convenience to the compiler specific extension __asm__. there will
> > be further issues with varying syntaxes that __asm__-style extensions
> > take from compiler to compiler as well.  
> 
> Yes we need to make sure there is no specific extension involved.
> Is C++ asm the same as the C __asm__?
> 
> > would you prefer that i change the preprocessor protection to include only
> > windows? since i'm certain that this will break for any c++ compiler on
> > windows the moment any stl header is included.  
> 
> No, C++ is probably the right scope.
> 
> > let me know how to adjust the patch i'll submit a new version.  
> 
> I don't know yet. I would like to understand the global picture,
> and have it properly documented in this commit log.
> 

There should be some test for C++ application use of API.
There doesn't appear to be one in the current CI suite.


  reply	other threads:[~2021-03-24 19:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-24  4:26 Tyler Retzlaff
2021-03-24  8:30 ` Thomas Monjalon
2021-03-24 16:45   ` Tyler Retzlaff
2021-03-24 17:04     ` Thomas Monjalon
2021-03-24 17:28       ` Tyler Retzlaff
2021-03-24 17:52         ` Thomas Monjalon
2021-03-24 19:52           ` Stephen Hemminger [this message]
2021-03-24 21:58             ` Tyler Retzlaff
2021-03-24 21:55           ` Tyler Retzlaff
2021-03-24 22:41             ` Dmitry Kozlyuk
2021-03-25  0:09               ` Tyler Retzlaff
2021-03-25  8:00                 ` Thomas Monjalon
2021-03-25 18:50                   ` Tyler Retzlaff
2021-04-13 13:10                     ` Thomas Monjalon
2021-04-13 13:35 ` Thomas Monjalon
2021-04-17  1:16   ` Tyler Retzlaff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210324125228.5dca333a@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=drc@linux.vnet.ibm.com \
    --cc=roretzla@linux.microsoft.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).