public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
* [PATCH] drivers: disable comma warnings selectively
@ 2026-02-13 15:14 Bruce Richardson
  2026-02-13 17:25 ` Stephen Hemminger
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Bruce Richardson @ 2026-02-13 15:14 UTC (permalink / raw)
  To: dev
  Cc: Bruce Richardson, Selwin Sebastian, Kishore Padmanabha,
	Ajit Khaparde, Jeroen de Borst, Joshua Washington, Rosen Xu

Rather than disabling -Wcomma for all drivers, only disable it on a
case-by-case basis for drivers that need it disabled. Use a variable to
do so, to avoid issues with compilers like MSVC that don't support the
-Wno-comma flag.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
NOTE: this builds cleanly for me on my system with most drivers enabled
and builds clean in the github CI. Hoping the other CIs will catch issues
with any other drivers that I haven't been able to test due to missing
deps on my system. If any issues show up in CI, will fix in V2.
---
 config/meson.build                 | 6 ++++++
 drivers/meson.build                | 2 +-
 drivers/net/axgbe/meson.build      | 4 +++-
 drivers/net/bnxt/meson.build       | 1 +
 drivers/net/gve/meson.build        | 1 +
 drivers/raw/ifpga/base/meson.build | 1 +
 6 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/config/meson.build b/config/meson.build
index 02e2798cca..9ba7b9a338 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -367,6 +367,12 @@ if cc.has_argument('-Wno-shadow')
     no_shadow_cflag = '-Wno-shadow'
 endif

+# per-driver option to disable -Wcomma if supported by the compiler
+no_comma_cflag = []
+if cc.has_argument('-Wno-comma')
+    no_comma_cflag = '-Wno-comma'
+endif
+
 foreach arg: global_cflags
     if cc.has_argument(arg)
         add_project_arguments(arg, language: 'c')
diff --git a/drivers/meson.build b/drivers/meson.build
index 3fe3be48fb..6ae102e943 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -86,7 +86,7 @@ default_cflags = machine_args
 default_cflags += ['-DALLOW_EXPERIMENTAL_API']
 default_cflags += ['-DALLOW_INTERNAL_API']

-warning_disable_cflags = ['-Wno-format-truncation', '-Wno-address-of-packed-member', '-Wno-comma']
+warning_disable_cflags = ['-Wno-format-truncation', '-Wno-address-of-packed-member']
 foreach cflag:warning_disable_cflags
     if cc.has_argument(cflag)
         default_cflags += cflag
diff --git a/drivers/net/axgbe/meson.build b/drivers/net/axgbe/meson.build
index 5a14549317..1aa523a749 100644
--- a/drivers/net/axgbe/meson.build
+++ b/drivers/net/axgbe/meson.build
@@ -15,7 +15,9 @@ sources = files(
         'axgbe_rxtx.c',
 )

-cflags += ['-Wno-cast-qual', no_shadow_cflag]
+cflags += ['-Wno-cast-qual']
+cflags += no_shadow_cflag
+cflags += no_comma_cflag

 if arch_subdir == 'x86'
     sources += files('axgbe_rxtx_vec_sse.c')
diff --git a/drivers/net/bnxt/meson.build b/drivers/net/bnxt/meson.build
index dc122fb3df..e13aa4e341 100644
--- a/drivers/net/bnxt/meson.build
+++ b/drivers/net/bnxt/meson.build
@@ -14,6 +14,7 @@ endif

 cflags += no_wvla_cflag
 cflags += no_shadow_cflag
+cflags += no_comma_cflag

 headers = files('rte_pmd_bnxt.h')
 cflags_options = [
diff --git a/drivers/net/gve/meson.build b/drivers/net/gve/meson.build
index add431c2bb..b5d67ee490 100644
--- a/drivers/net/gve/meson.build
+++ b/drivers/net/gve/meson.build
@@ -20,3 +20,4 @@ sources = files(
 includes += include_directories('base')

 cflags += no_wvla_cflag
+cflags += no_comma_cflag
diff --git a/drivers/raw/ifpga/base/meson.build b/drivers/raw/ifpga/base/meson.build
index efebff94e9..225bde052b 100644
--- a/drivers/raw/ifpga/base/meson.build
+++ b/drivers/raw/ifpga/base/meson.build
@@ -24,3 +24,4 @@ base_sources = files(
         'opae_at24_eeprom.c',
         'opae_eth_group.c',
 )
+base_cflags += no_comma_cflag
--
2.51.0


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

* Re: [PATCH] drivers: disable comma warnings selectively
  2026-02-13 15:14 [PATCH] drivers: disable comma warnings selectively Bruce Richardson
@ 2026-02-13 17:25 ` Stephen Hemminger
  2026-02-13 17:35   ` Bruce Richardson
  2026-02-13 18:47 ` Stephen Hemminger
  2026-02-19 15:22 ` [PATCH v2] " Bruce Richardson
  2 siblings, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2026-02-13 17:25 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: dev, Selwin Sebastian, Kishore Padmanabha, Ajit Khaparde,
	Jeroen de Borst, Joshua Washington, Rosen Xu

On Fri, 13 Feb 2026 15:14:00 +0000
Bruce Richardson <bruce.richardson@intel.com> wrote:

> Rather than disabling -Wcomma for all drivers, only disable it on a
> case-by-case basis for drivers that need it disabled. Use a variable to
> do so, to avoid issues with compilers like MSVC that don't support the
> -Wno-comma flag.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Some of those drivers should be easy to fix?

This change would be helped by fixing and introducing FOREACH_SAFE macros.
I started that but it never got anywhere

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

* Re: [PATCH] drivers: disable comma warnings selectively
  2026-02-13 17:25 ` Stephen Hemminger
@ 2026-02-13 17:35   ` Bruce Richardson
  0 siblings, 0 replies; 6+ messages in thread
From: Bruce Richardson @ 2026-02-13 17:35 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: dev, Selwin Sebastian, Kishore Padmanabha, Ajit Khaparde,
	Jeroen de Borst, Joshua Washington, Rosen Xu

On Fri, Feb 13, 2026 at 09:25:17AM -0800, Stephen Hemminger wrote:
> On Fri, 13 Feb 2026 15:14:00 +0000
> Bruce Richardson <bruce.richardson@intel.com> wrote:
> 
> > Rather than disabling -Wcomma for all drivers, only disable it on a
> > case-by-case basis for drivers that need it disabled. Use a variable to
> > do so, to avoid issues with compilers like MSVC that don't support the
> > -Wno-comma flag.
> > 
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> 
> Some of those drivers should be easy to fix?
> 
Yep.

Unfortunately there are lots of CI errors with this patch because I forgot
that the Intel driver cleanups are still on next-net-intel tree rather than
main.

For other drivers, I didn't actually take time to investigate fixing these,
I was mainly interested in the scope of the problem and ensuring that any
drivers that are without issues stay that way. It was only after it was
done that I realised how few problems there actually are.

> This change would be helped by fixing and introducing FOREACH_SAFE macros.
> I started that but it never got anywhere

Right. However, it's not a really big blocker here. Quick fixes to remove
the use of comma can be done without a major refactor.

/Bruce

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

* Re: [PATCH] drivers: disable comma warnings selectively
  2026-02-13 15:14 [PATCH] drivers: disable comma warnings selectively Bruce Richardson
  2026-02-13 17:25 ` Stephen Hemminger
@ 2026-02-13 18:47 ` Stephen Hemminger
  2026-02-19 15:22 ` [PATCH v2] " Bruce Richardson
  2 siblings, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2026-02-13 18:47 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: dev, Selwin Sebastian, Kishore Padmanabha, Ajit Khaparde,
	Jeroen de Borst, Joshua Washington, Rosen Xu

On Fri, 13 Feb 2026 15:14:00 +0000
Bruce Richardson <bruce.richardson@intel.com> wrote:

> Rather than disabling -Wcomma for all drivers, only disable it on a
> case-by-case basis for drivers that need it disabled. Use a variable to
> do so, to avoid issues with compilers like MSVC that don't support the
> -Wno-comma flag.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---

Marking as deferred until Intel driver fixes hit

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

* [PATCH v2] drivers: disable comma warnings selectively
  2026-02-13 15:14 [PATCH] drivers: disable comma warnings selectively Bruce Richardson
  2026-02-13 17:25 ` Stephen Hemminger
  2026-02-13 18:47 ` Stephen Hemminger
@ 2026-02-19 15:22 ` Bruce Richardson
  2026-02-19 21:53   ` Stephen Hemminger
  2 siblings, 1 reply; 6+ messages in thread
From: Bruce Richardson @ 2026-02-19 15:22 UTC (permalink / raw)
  To: dev
  Cc: stephen, Bruce Richardson, Selwin Sebastian, Kishore Padmanabha,
	Ajit Khaparde, Jeroen de Borst, Joshua Washington, Rosen Xu

Rather than disabling -Wcomma for all drivers, only disable it on a
case-by-case basis for drivers that need it disabled. Use a variable to
do so, to avoid issues with compilers like MSVC that don't support the
-Wno-comma flag.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
V2: resubmit now that dependent patches have hit main
---
 config/meson.build                 | 6 ++++++
 drivers/meson.build                | 2 +-
 drivers/net/axgbe/meson.build      | 4 +++-
 drivers/net/bnxt/meson.build       | 1 +
 drivers/net/gve/meson.build        | 1 +
 drivers/raw/ifpga/base/meson.build | 1 +
 6 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/config/meson.build b/config/meson.build
index 02e2798cca..9ba7b9a338 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -367,6 +367,12 @@ if cc.has_argument('-Wno-shadow')
     no_shadow_cflag = '-Wno-shadow'
 endif
 
+# per-driver option to disable -Wcomma if supported by the compiler
+no_comma_cflag = []
+if cc.has_argument('-Wno-comma')
+    no_comma_cflag = '-Wno-comma'
+endif
+
 foreach arg: global_cflags
     if cc.has_argument(arg)
         add_project_arguments(arg, language: 'c')
diff --git a/drivers/meson.build b/drivers/meson.build
index 3fe3be48fb..6ae102e943 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -86,7 +86,7 @@ default_cflags = machine_args
 default_cflags += ['-DALLOW_EXPERIMENTAL_API']
 default_cflags += ['-DALLOW_INTERNAL_API']
 
-warning_disable_cflags = ['-Wno-format-truncation', '-Wno-address-of-packed-member', '-Wno-comma']
+warning_disable_cflags = ['-Wno-format-truncation', '-Wno-address-of-packed-member']
 foreach cflag:warning_disable_cflags
     if cc.has_argument(cflag)
         default_cflags += cflag
diff --git a/drivers/net/axgbe/meson.build b/drivers/net/axgbe/meson.build
index 5a14549317..1aa523a749 100644
--- a/drivers/net/axgbe/meson.build
+++ b/drivers/net/axgbe/meson.build
@@ -15,7 +15,9 @@ sources = files(
         'axgbe_rxtx.c',
 )
 
-cflags += ['-Wno-cast-qual', no_shadow_cflag]
+cflags += ['-Wno-cast-qual']
+cflags += no_shadow_cflag
+cflags += no_comma_cflag
 
 if arch_subdir == 'x86'
     sources += files('axgbe_rxtx_vec_sse.c')
diff --git a/drivers/net/bnxt/meson.build b/drivers/net/bnxt/meson.build
index dc122fb3df..e13aa4e341 100644
--- a/drivers/net/bnxt/meson.build
+++ b/drivers/net/bnxt/meson.build
@@ -14,6 +14,7 @@ endif
 
 cflags += no_wvla_cflag
 cflags += no_shadow_cflag
+cflags += no_comma_cflag
 
 headers = files('rte_pmd_bnxt.h')
 cflags_options = [
diff --git a/drivers/net/gve/meson.build b/drivers/net/gve/meson.build
index add431c2bb..b5d67ee490 100644
--- a/drivers/net/gve/meson.build
+++ b/drivers/net/gve/meson.build
@@ -20,3 +20,4 @@ sources = files(
 includes += include_directories('base')
 
 cflags += no_wvla_cflag
+cflags += no_comma_cflag
diff --git a/drivers/raw/ifpga/base/meson.build b/drivers/raw/ifpga/base/meson.build
index efebff94e9..225bde052b 100644
--- a/drivers/raw/ifpga/base/meson.build
+++ b/drivers/raw/ifpga/base/meson.build
@@ -24,3 +24,4 @@ base_sources = files(
         'opae_at24_eeprom.c',
         'opae_eth_group.c',
 )
+base_cflags += no_comma_cflag
-- 
2.51.0


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

* Re: [PATCH v2] drivers: disable comma warnings selectively
  2026-02-19 15:22 ` [PATCH v2] " Bruce Richardson
@ 2026-02-19 21:53   ` Stephen Hemminger
  0 siblings, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2026-02-19 21:53 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: dev, Selwin Sebastian, Kishore Padmanabha, Ajit Khaparde,
	Jeroen de Borst, Joshua Washington, Rosen Xu

On Thu, 19 Feb 2026 15:22:25 +0000
Bruce Richardson <bruce.richardson@intel.com> wrote:

> Rather than disabling -Wcomma for all drivers, only disable it on a
> case-by-case basis for drivers that need it disabled. Use a variable to
> do so, to avoid issues with compilers like MSVC that don't support the
> -Wno-comma flag.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---

Queued to next-net

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

end of thread, other threads:[~2026-02-19 21:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-13 15:14 [PATCH] drivers: disable comma warnings selectively Bruce Richardson
2026-02-13 17:25 ` Stephen Hemminger
2026-02-13 17:35   ` Bruce Richardson
2026-02-13 18:47 ` Stephen Hemminger
2026-02-19 15:22 ` [PATCH v2] " Bruce Richardson
2026-02-19 21:53   ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox