DPDK patches and discussions
 help / color / mirror / Atom feed
From: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
To: Aaron Conole <aconole@redhat.com>
Cc: Thomas Monjalon <thomas@monjalon.net>,
	Tal Shnaiderman <talshn@nvidia.com>,
	"dev\@dpdk.org" <dev@dpdk.org>,
	"pallavi.kadam\@intel.com" <pallavi.kadam@intel.com>,
	"navasile\@linux.microsoft.com" <navasile@linux.microsoft.com>,
	"dmitrym\@microsoft.com" <dmitrym@microsoft.com>,
	ci@dpdk.org
Subject: Re: [dpdk-dev] [dpdk-ci] [PATCH] eal/windows: fix build warnings in MinGW
Date: Mon, 19 Apr 2021 23:09:36 +0300	[thread overview]
Message-ID: <20210419230936.04e2f95c@sovereign> (raw)
In-Reply-To: <f7tim4ivzs3.fsf@dhcp-25.97.bos.redhat.com>

2021-04-19 15:29 (UTC-0400), Aaron Conole:
> Thomas Monjalon <thomas@monjalon.net> writes:
> 
> > 19/04/2021 20:06, Tal Shnaiderman:  
> >> > > 2021-04-18 19:04 (UTC+0000), Tal Shnaiderman:  
> >> > > > > 18/04/2021 19:08, Tal Shnaiderman:  
> >> > > > > > the strncasecmp marco defined in rte_os_shim.h is already
> >> > > > > > defined in MinGW-w64, as a result the compiler prints out the
> >> > > > > > warning below on function redefinition whenever compiling a file
> >> > > > > > including the  
> >> > > header.  
> >> > > > > >
> >> > > > > > ..\lib/librte_eal/windows/include/rte_os_shim.h:21:
> >> > > > > > warning: "strncasecmp" redefined #define strncasecmp(s1, s2,
> >> > > > > > count) _strnicmp(s1, s2, count)  
> >> > > > >
> >> > > > > Why the tests are passing? Are we allowing warnings in build test?  
> >> > > >
> >> > > > It's a good question, I see CI is passing without warnings, Dmitry
> >> > > > can you  
> >> > > reproduce it?  
> >> > > >
> >> > > > On my side the collision is with the following file:
> >> > > >
> >> > > > C:/mingw-w64/x86_64/mingw64/x86_64-w64-  
> >> > > mingw32/include/string.h:119:  
> >> > > > note: this is the location of the previous definition  #define
> >> > > > strncasecmp _strnicmp
> >> > > >
> >> > > > I'm using:
> >> > > > -gcc (x86_64-win32-seh-rev0, Built by MinGW-W64 project) 8.1.0
> >> > > > -meson
> >> > > > 0.53.2  
> >> > >
> >> > > I can't reproduce it using the same versions.
> >> > > Do you invoke meson with other options than "-Dexamples=..."?  
> >> > 
> >> > This is the meson line I'm using:
> >> > 
> >> > meson "-Dexamples=helloworld" build --wipe --default-library=static --
> >> > buildtype debug
> >> > 
> >> > The problem however is that MinGW's string.h defines the macro in line 119,
> >> > for some reason my build includes it and the rest doesn't.  
> >> 
> >> Hi Dmitry,
> >> 
> >> I also noticed warnings in clang on my setup that are related to rte_os_shim.h:
> >> 
> >> [185/314] Compiling C object drivers/a715181@@tmp_rte_common_mlx5@sta/common_mlx5_mlx5_common_mp.c.obj.
> >> In file included from ../drivers/common/mlx5/mlx5_common_mp.c:13:
> >> In file included from ..\drivers\common/mlx5/mlx5_common_utils.h:8:
> >> In file included from ..\drivers\common/mlx5/mlx5_common.h:17:
> >> ..\lib/librte_eal/windows/include\rte_os_shim.h:22:51: warning:
> >> token pasting of ',' and __VA_ARGS__ is a GNU extension
> >> [-Wgnu-zero-variadic-macro-arguments]
> >> #define open(path, flags, ...) _open(path, flags, ##__VA_ARGS__)
> >>                                                   ^
> >> However don't see it in CI, I'm using clang version 9.0.1  
> >
> > It seems we should improve our CI.
> > Please open suggestions in the CI bugzilla.  
> 
> Please do.
> 
> Will this only be caught by mingw64 on windows?  Will we get the same
> issues with a linux mingw install?  I'm guessing yes, but don't know
> mingw very well.  We may be able to install the mingw package under our
> github actions pipeline.

Yes, Linux MinGW-w64 produces the same warning (about strncasecmp).
__VA_ARGS__ warning won't show up with GNU compiler, obviously.
It may with ICC, but I don't have it to check.

I figured out it's not --default-library=static, but --buildtype=debug that
caues the arning to appear, my mistake in previous message.

  reply	other threads:[~2021-04-19 20:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-18 17:08 [dpdk-dev] " Tal Shnaiderman
2021-04-18 18:13 ` Thomas Monjalon
2021-04-18 19:04   ` Tal Shnaiderman
2021-04-18 20:23     ` Dmitry Kozlyuk
2021-04-19  6:57       ` Tal Shnaiderman
2021-04-19 18:06         ` Tal Shnaiderman
2021-04-19 18:15           ` Thomas Monjalon
2021-04-19 19:29             ` [dpdk-dev] [dpdk-ci] " Aaron Conole
2021-04-19 20:09               ` Dmitry Kozlyuk [this message]
2021-04-19 20:33                 ` Lincoln Lavoie
2021-04-20 11:01                 ` Tal Shnaiderman
2021-04-19 19:45           ` [dpdk-dev] " Dmitry Kozlyuk
2021-04-19 18:55         ` Dmitry Kozlyuk
2021-04-21 16:09 ` [dpdk-dev] [PATCH v2] " Tal Shnaiderman
2021-04-26 15:58   ` Dmitry Kozlyuk
2021-05-04 17:17     ` Thomas Monjalon

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=20210419230936.04e2f95c@sovereign \
    --to=dmitry.kozliuk@gmail.com \
    --cc=aconole@redhat.com \
    --cc=ci@dpdk.org \
    --cc=dev@dpdk.org \
    --cc=dmitrym@microsoft.com \
    --cc=navasile@linux.microsoft.com \
    --cc=pallavi.kadam@intel.com \
    --cc=talshn@nvidia.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).