DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andrius Sirvys <andrius.sirvys@intel.com>
To: bruce.richardson@intel.com
Cc: dev@dpdk.org, Andrius Sirvys <andrius.sirvys@intel.com>
Subject: [dpdk-dev] [PATCH] build: add meson support for icc
Date: Tue, 26 Feb 2019 14:18:09 +0000	[thread overview]
Message-ID: <1551190689-139613-1-git-send-email-andrius.sirvys@intel.com> (raw)

When building with mason, checks if the compiler is icc. If they match,
the warning_flags are changed to ensure icc compilation is successful.

Disabled error 3656: "variable may be used before its value is set"
in librte_telemetry, bnx2x, ixgbe and sfc as they were false positives.

Signed-off-by: Andrius Sirvys <andrius.sirvys@intel.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 config/meson.build               | 22 +++++++++++++++++-----
 drivers/net/bnx2x/meson.build    |  1 +
 drivers/net/ixgbe/meson.build    |  3 +++
 drivers/net/sfc/meson.build      |  3 +++
 lib/librte_telemetry/meson.build |  1 +
 5 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/config/meson.build b/config/meson.build
index db32499..34be1ee 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -85,11 +85,23 @@ endif
 add_project_arguments('-include', 'rte_config.h', language: 'c')
 
 # enable extra warnings and disable any unwanted warnings
-warning_flags = [
-	'-Wsign-compare',
-	'-Wcast-qual',
-	'-Wno-address-of-packed-member'
-]
+icc_warn_uninit = []
+if cc.get_id()=='intel'
+# variable may be used before its value is set
+	icc_warn_uninit = ['-diag-disable 3656']
+	warning_flags = [
+		'-diag-disable 188', # enumerated type mixed with another type
+		'-diag-disable 1338', # arithmetic on pointer to void or function type
+		'-diag-disable 279', # controlling expression is constant
+	]
+else
+	warning_flags = [
+		'-Wsign-compare',
+		'-Wcast-qual',
+		'-Wno-address-of-packed-member'
+	]
+endif
+
 if cc.sizeof('void *') == 4
 # for 32-bit, don't warn about casting a 32-bit pointer to 64-bit int - it's fine!!
 	warning_flags += '-Wno-pointer-to-int-cast'
diff --git a/drivers/net/bnx2x/meson.build b/drivers/net/bnx2x/meson.build
index e3c6888..d0e8b6f 100644
--- a/drivers/net/bnx2x/meson.build
+++ b/drivers/net/bnx2x/meson.build
@@ -5,6 +5,7 @@ dep = cc.find_library('z', required: false)
 build = dep.found()
 ext_deps += dep
 cflags += '-DZLIB_CONST'
+cflags += icc_warn_uninit
 sources = files('bnx2x.c',
 	'bnx2x_ethdev.c',
 	'bnx2x_rxtx.c',
diff --git a/drivers/net/ixgbe/meson.build b/drivers/net/ixgbe/meson.build
index 544a141..33e5d58 100644
--- a/drivers/net/ixgbe/meson.build
+++ b/drivers/net/ixgbe/meson.build
@@ -5,6 +5,9 @@ version = 2
 
 cflags += ['-DRTE_LIBRTE_IXGBE_BYPASS']
 
+# Flags for icc compiler
+cflags += icc_warn_uninit
+
 allow_experimental_apis = true
 
 subdir('base')
diff --git a/drivers/net/sfc/meson.build b/drivers/net/sfc/meson.build
index 2d34e86..b3424d4 100644
--- a/drivers/net/sfc/meson.build
+++ b/drivers/net/sfc/meson.build
@@ -30,6 +30,9 @@ extra_flags += [
 	'-Wbad-function-cast'
 ]
 
+# Flags for icc compiler
+extra_flags += icc_warn_uninit
+
 foreach flag: extra_flags
 	if cc.has_argument(flag)
 		cflags += flag
diff --git a/lib/librte_telemetry/meson.build b/lib/librte_telemetry/meson.build
index 9492f54..19726e3 100644
--- a/lib/librte_telemetry/meson.build
+++ b/lib/librte_telemetry/meson.build
@@ -5,6 +5,7 @@ sources = files('rte_telemetry.c', 'rte_telemetry_parser.c', 'rte_telemetry_pars
 headers = files('rte_telemetry.h', 'rte_telemetry_internal.h', 'rte_telemetry_parser.h', 'rte_telemetry_parser_test.h')
 deps += ['metrics', 'ethdev']
 cflags += '-DALLOW_EXPERIMENTAL_API'
+cflags += icc_warn_uninit
 
 jansson = cc.find_library('jansson', required: false)
 if jansson.found()
-- 
2.7.4

             reply	other threads:[~2019-02-26 14:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-26 14:18 Andrius Sirvys [this message]
2019-02-26 14:26 ` Bruce Richardson
2019-02-26 17:44 ` 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=1551190689-139613-1-git-send-email-andrius.sirvys@intel.com \
    --to=andrius.sirvys@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    /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).