patches for DPDK stable branches
 help / color / Atom feed
* [dpdk-stable] [PATCH v3 0/2] build: add Wformat to fix gcc compile warnings and format fixes
       [not found] <20201118181103.3865787-1-conor.walsh@intel.com>
@ 2020-11-19 10:16 ` Conor Walsh
  2020-11-19 10:16   ` [dpdk-stable] [PATCH v3 1/2] build: fix gcc compile warnings by adding wformat Conor Walsh
                     ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Conor Walsh @ 2020-11-19 10:16 UTC (permalink / raw)
  To: bruce.richardson, ajit.khaparde, somnath.kotur, bluca,
	stuart.schacher, venkatkumar.duvvuru, michael.wildt
  Cc: dev, stable, linglix.chen, thomas, Conor Walsh

On some systems Wformat-nonliteral and Wformat-security could not be
checked without Wformat also being specified this causes a compile
warning on these systems. This patchset adds Wformat to
config/meson.build and fixes some format issues that this exposed.

---

v3: add stable@dpdk.org to cc list following list feedback

v2:
- expand explaination of patches
- suppress false postives in icc
- add fixes for format issues

Conor Walsh (2):
  build: fix gcc compile warnings by adding wformat
  net/bnxt: fix format characters for unsigned values

 config/meson.build                 | 3 ++-
 drivers/net/bnxt/tf_core/tf_core.c | 8 ++++----
 2 files changed, 6 insertions(+), 5 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-stable] [PATCH v3 1/2] build: fix gcc compile warnings by adding wformat
  2020-11-19 10:16 ` [dpdk-stable] [PATCH v3 0/2] build: add Wformat to fix gcc compile warnings and format fixes Conor Walsh
@ 2020-11-19 10:16   ` Conor Walsh
  2020-11-20  7:23     ` Chen, LingliX
  2020-11-19 10:17   ` [dpdk-stable] [PATCH v3 2/2] net/bnxt: fix format characters for unsigned values Conor Walsh
  2020-11-22 20:07   ` [dpdk-stable] [PATCH v3 0/2] build: add Wformat to fix gcc compile warnings and format fixes Thomas Monjalon
  2 siblings, 1 reply; 6+ messages in thread
From: Conor Walsh @ 2020-11-19 10:16 UTC (permalink / raw)
  To: bruce.richardson, ajit.khaparde, somnath.kotur, bluca,
	stuart.schacher, venkatkumar.duvvuru, michael.wildt
  Cc: dev, stable, linglix.chen, thomas, Conor Walsh, Chen

On some CentOS/RHEL systems using gcc 8.3.1 to compile dpdk, gcc shows a
warning on every build step saying that -Wformat-nonliteral and
-Wformat-security warnings will be ignored unless -Wformat is
also specified as a compiler flag. When the build is run with -werror
the build will fail due to these warnings.

Exact warning returned:
cc1: error: -Wformat-nonliteral ignored without -Wformat
[-Werror=format-nonliteral]
cc1: error: -Wformat-security ignored without -Wformat
[-Werror=format-security]
cc1: all warnings being treated as errors

This patch adds the -Wformat flag to config/meson.build. The warning id
181 has also been suppressed in icc as icc was showing false positives
with -Wformat enabled.

Fixes: 524a0d5d66b9 ("build: enable extra warnings with meson")
Cc: bruce.richardson@intel.com

Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Tested-by: Chen, LingliX <linglix.chen@intel.com>
---
 config/meson.build | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/config/meson.build b/config/meson.build
index a29693b883..c02802c18e 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -194,6 +194,7 @@ warning_flags = [
 	# additional warnings in alphabetical order
 	'-Wcast-qual',
 	'-Wdeprecated',
+	'-Wformat',
 	'-Wformat-nonliteral',
 	'-Wformat-security',
 	'-Wmissing-declarations',
@@ -220,7 +221,7 @@ if not dpdk_conf.get('RTE_ARCH_64')
 	warning_flags += '-Wno-pointer-to-int-cast'
 endif
 if cc.get_id() == 'intel'
-	warning_ids = [188, 2203, 2279, 2557, 3179, 3656]
+	warning_ids = [181, 188, 2203, 2279, 2557, 3179, 3656]
 	foreach i:warning_ids
 		warning_flags += '-diag-disable=@0@'.format(i)
 	endforeach
-- 
2.25.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-stable] [PATCH v3 2/2] net/bnxt: fix format characters for unsigned values
  2020-11-19 10:16 ` [dpdk-stable] [PATCH v3 0/2] build: add Wformat to fix gcc compile warnings and format fixes Conor Walsh
  2020-11-19 10:16   ` [dpdk-stable] [PATCH v3 1/2] build: fix gcc compile warnings by adding wformat Conor Walsh
@ 2020-11-19 10:17   ` Conor Walsh
  2020-11-19 23:12     ` Ajit Khaparde
  2020-11-22 20:07   ` [dpdk-stable] [PATCH v3 0/2] build: add Wformat to fix gcc compile warnings and format fixes Thomas Monjalon
  2 siblings, 1 reply; 6+ messages in thread
From: Conor Walsh @ 2020-11-19 10:17 UTC (permalink / raw)
  To: bruce.richardson, ajit.khaparde, somnath.kotur, bluca,
	stuart.schacher, venkatkumar.duvvuru, michael.wildt
  Cc: dev, stable, linglix.chen, thomas, Conor Walsh

&device requires the %u format specifer not the %d specifier, as
&device is unsigned.

Fixes: a46bbb57605b ("net/bnxt: update multi device design")
Cc: michael.wildt@broadcom.com

Signed-off-by: Conor Walsh <conor.walsh@intel.com>
---
 drivers/net/bnxt/tf_core/tf_core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/bnxt/tf_core/tf_core.c b/drivers/net/bnxt/tf_core/tf_core.c
index 0f49a00256..24d49096a7 100644
--- a/drivers/net/bnxt/tf_core/tf_core.c
+++ b/drivers/net/bnxt/tf_core/tf_core.c
@@ -44,7 +44,7 @@ tf_open_session(struct tf *tfp,
 
 	/* Verify control channel and build the beginning of session_id */
 	rc = sscanf(parms->ctrl_chan_name,
-		    "%x:%x:%x.%d",
+		    "%x:%x:%x.%u",
 		    &domain,
 		    &bus,
 		    &slot,
@@ -57,7 +57,7 @@ tf_open_session(struct tf *tfp,
 
 		/* Check parsing of bus/slot/device */
 		rc = sscanf(parms->ctrl_chan_name,
-			    "%x:%x.%d",
+			    "%x:%x.%u",
 			    &bus,
 			    &slot,
 			    &device);
@@ -102,7 +102,7 @@ tf_attach_session(struct tf *tfp,
 
 	/* Verify control channel */
 	rc = sscanf(parms->ctrl_chan_name,
-		    "%x:%x:%x.%d",
+		    "%x:%x:%x.%u",
 		    &domain,
 		    &bus,
 		    &slot,
@@ -115,7 +115,7 @@ tf_attach_session(struct tf *tfp,
 
 	/* Verify 'attach' channel */
 	rc = sscanf(parms->attach_chan_name,
-		    "%x:%x:%x.%d",
+		    "%x:%x:%x.%u",
 		    &domain,
 		    &bus,
 		    &slot,
-- 
2.25.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-stable] [PATCH v3 2/2] net/bnxt: fix format characters for unsigned values
  2020-11-19 10:17   ` [dpdk-stable] [PATCH v3 2/2] net/bnxt: fix format characters for unsigned values Conor Walsh
@ 2020-11-19 23:12     ` Ajit Khaparde
  0 siblings, 0 replies; 6+ messages in thread
From: Ajit Khaparde @ 2020-11-19 23:12 UTC (permalink / raw)
  To: Conor Walsh
  Cc: Bruce Richardson, Somnath Kotur, Luca Boccassi, Randy Schacher,
	Venkat Duvvuru, Michael Wildt, dpdk-dev, dpdk stable,
	linglix.chen, Thomas Monjalon

On Thu, Nov 19, 2020 at 2:17 AM Conor Walsh <conor.walsh@intel.com> wrote:
>
> &device requires the %u format specifer not the %d specifier, as
> &device is unsigned.
>
> Fixes: a46bbb57605b ("net/bnxt: update multi device design")
> Cc: michael.wildt@broadcom.com
>
> Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>

> ---
>  drivers/net/bnxt/tf_core/tf_core.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/bnxt/tf_core/tf_core.c b/drivers/net/bnxt/tf_core/tf_core.c
> index 0f49a00256..24d49096a7 100644
> --- a/drivers/net/bnxt/tf_core/tf_core.c
> +++ b/drivers/net/bnxt/tf_core/tf_core.c
> @@ -44,7 +44,7 @@ tf_open_session(struct tf *tfp,
>
>         /* Verify control channel and build the beginning of session_id */
>         rc = sscanf(parms->ctrl_chan_name,
> -                   "%x:%x:%x.%d",
> +                   "%x:%x:%x.%u",
>                     &domain,
>                     &bus,
>                     &slot,
> @@ -57,7 +57,7 @@ tf_open_session(struct tf *tfp,
>
>                 /* Check parsing of bus/slot/device */
>                 rc = sscanf(parms->ctrl_chan_name,
> -                           "%x:%x.%d",
> +                           "%x:%x.%u",
>                             &bus,
>                             &slot,
>                             &device);
> @@ -102,7 +102,7 @@ tf_attach_session(struct tf *tfp,
>
>         /* Verify control channel */
>         rc = sscanf(parms->ctrl_chan_name,
> -                   "%x:%x:%x.%d",
> +                   "%x:%x:%x.%u",
>                     &domain,
>                     &bus,
>                     &slot,
> @@ -115,7 +115,7 @@ tf_attach_session(struct tf *tfp,
>
>         /* Verify 'attach' channel */
>         rc = sscanf(parms->attach_chan_name,
> -                   "%x:%x:%x.%d",
> +                   "%x:%x:%x.%u",
>                     &domain,
>                     &bus,
>                     &slot,
> --
> 2.25.1
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-stable] [PATCH v3 1/2] build: fix gcc compile warnings by adding wformat
  2020-11-19 10:16   ` [dpdk-stable] [PATCH v3 1/2] build: fix gcc compile warnings by adding wformat Conor Walsh
@ 2020-11-20  7:23     ` Chen, LingliX
  0 siblings, 0 replies; 6+ messages in thread
From: Chen, LingliX @ 2020-11-20  7:23 UTC (permalink / raw)
  To: Walsh, Conor, Richardson, Bruce, ajit.khaparde, somnath.kotur,
	bluca, stuart.schacher, venkatkumar.duvvuru, michael.wildt
  Cc: dev, stable, thomas

Tested-by:  Chen, LingliX <linglix.chen@intel.com>

Regards,
Chen, LingliX

> -----Original Message-----
> From: Walsh, Conor
> Sent: Thursday, November 19, 2020 6:17 PM
> To: Richardson, Bruce <bruce.richardson@intel.com>;
> ajit.khaparde@broadcom.com; somnath.kotur@broadcom.com;
> bluca@debian.org; stuart.schacher@broadcom.com;
> venkatkumar.duvvuru@broadcom.com; michael.wildt@broadcom.com
> Cc: dev@dpdk.org; stable@dpdk.org; Chen, LingliX <linglix.chen@intel.com>;
> thomas@monjalon.net; Walsh, Conor <conor.walsh@intel.com>; Chen
> Subject: [PATCH v3 1/2] build: fix gcc compile warnings by adding wformat


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-stable] [PATCH v3 0/2] build: add Wformat to fix gcc compile warnings and format fixes
  2020-11-19 10:16 ` [dpdk-stable] [PATCH v3 0/2] build: add Wformat to fix gcc compile warnings and format fixes Conor Walsh
  2020-11-19 10:16   ` [dpdk-stable] [PATCH v3 1/2] build: fix gcc compile warnings by adding wformat Conor Walsh
  2020-11-19 10:17   ` [dpdk-stable] [PATCH v3 2/2] net/bnxt: fix format characters for unsigned values Conor Walsh
@ 2020-11-22 20:07   ` Thomas Monjalon
  2 siblings, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2020-11-22 20:07 UTC (permalink / raw)
  To: Conor Walsh
  Cc: bruce.richardson, ajit.khaparde, somnath.kotur, bluca,
	stuart.schacher, venkatkumar.duvvuru, michael.wildt, stable, dev,
	linglix.chen, david.marchand

19/11/2020 11:16, Conor Walsh:
> On some systems Wformat-nonliteral and Wformat-security could not be
> checked without Wformat also being specified this causes a compile
> warning on these systems. This patchset adds Wformat to
> config/meson.build and fixes some format issues that this exposed.
> 
> ---
> 
> v3: add stable@dpdk.org to cc list following list feedback

The Cc: stable@dpdk.org must be part of the commit log.
Please at other patches (and contributors guidelines) for inspiration.

Series applied, thanks.



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, back to index

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20201118181103.3865787-1-conor.walsh@intel.com>
2020-11-19 10:16 ` [dpdk-stable] [PATCH v3 0/2] build: add Wformat to fix gcc compile warnings and format fixes Conor Walsh
2020-11-19 10:16   ` [dpdk-stable] [PATCH v3 1/2] build: fix gcc compile warnings by adding wformat Conor Walsh
2020-11-20  7:23     ` Chen, LingliX
2020-11-19 10:17   ` [dpdk-stable] [PATCH v3 2/2] net/bnxt: fix format characters for unsigned values Conor Walsh
2020-11-19 23:12     ` Ajit Khaparde
2020-11-22 20:07   ` [dpdk-stable] [PATCH v3 0/2] build: add Wformat to fix gcc compile warnings and format fixes Thomas Monjalon

patches for DPDK stable branches

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/ public-inbox