Skip to content

Commit 3ee3c1a

Browse files
shemmingertmonjalo
authored andcommitted
config: enable comma warnings
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 <[email protected]> Acked-by: Konstantin Ananyev <[email protected]> Acked-by: Chengwen Feng <[email protected]> Acked-by: Morten Brørup <[email protected]> Acked-by: Bruce Richardson <[email protected]>
1 parent 90ae5d5 commit 3ee3c1a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

config/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ endif
319319
global_cflags = [
320320
# additional warnings in alphabetical order
321321
'-Wcast-qual',
322+
'-Wcomma',
322323
'-Wdeprecated',
323324
'-Wformat',
324325
'-Wformat-nonliteral',

drivers/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ default_cflags = machine_args
8686
default_cflags += ['-DALLOW_EXPERIMENTAL_API']
8787
default_cflags += ['-DALLOW_INTERNAL_API']
8888

89-
warning_disable_cflags = ['-Wno-format-truncation', '-Wno-address-of-packed-member']
89+
warning_disable_cflags = ['-Wno-format-truncation', '-Wno-address-of-packed-member', '-Wno-comma']
9090
foreach cflag:warning_disable_cflags
9191
if cc.has_argument(cflag)
9292
default_cflags += cflag

0 commit comments

Comments
 (0)