waf: make implicit fallthroughs fatal

This commit is contained in:
Peter Barker 2019-12-17 13:21:30 +11:00 committed by Peter Barker
parent 9192cb7b41
commit 824a085097
1 changed files with 11 additions and 0 deletions

View File

@ -140,11 +140,17 @@ class Board:
'-Wno-inconsistent-missing-override',
'-Wno-mismatched-tags',
'-Wno-gnu-variable-sized-type-not-at-end',
'-Werror=implicit-fallthrough',
]
else:
env.CFLAGS += [
'-Wno-format-contains-nul',
]
(major, minor, patchlevel) = cfg.env.CC_VERSION
if int(major) > 7 or (int(major) == 7 and int(minor) >= 4):
env.CXXFLAGS += [
'-Werror=implicit-fallthrough',
]
if cfg.env.DEBUG:
env.CFLAGS += [
@ -227,6 +233,7 @@ class Board:
'-Wno-gnu-designator',
'-Wno-mismatched-tags',
'-Wno-gnu-variable-sized-type-not-at-end',
'-Werror=implicit-fallthrough',
]
else:
env.CXXFLAGS += [
@ -238,6 +245,10 @@ class Board:
env.CXXFLAGS += [
'-Werror=suggest-override',
]
if int(major) > 7 or (int(major) == 7 and int(minor) >= 4):
env.CXXFLAGS += [
'-Werror=implicit-fallthrough',
]
if cfg.env.DEBUG:
env.CXXFLAGS += [