Clang (3.9 or later) has a -Wcomma that emits warnings for questionable
uses of the comma operator.

Don't enable it for drivers since many drivers still use
comma operator unnecessarily.

Signed-off-by: Stephen Hemminger <step...@networkplumber.org>
---
 config/meson.build  | 1 +
 drivers/meson.build | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/config/meson.build b/config/meson.build
index f31fef216c..d9ff0e31c0 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -313,6 +313,7 @@ endif
 global_cflags = [
         # additional warnings in alphabetical order
         '-Wcast-qual',
+        '-Wcomma',
         '-Wdeprecated',
         '-Wformat',
         '-Wformat-nonliteral',
diff --git a/drivers/meson.build b/drivers/meson.build
index b62880db02..4c08a1dd9d 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -59,7 +59,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']
+warning_disable_cflags = ['-Wno-format-truncation', 
'-Wno-address-of-packed-member', '-Wno-comma']
 foreach cflag:warning_disable_cflags
     if cc.has_argument(cflag)
         default_cflags += cflag
-- 
2.47.2

Reply via email to