From 646bcca45a5b721143a38bfe22200b18435e37f7 Mon Sep 17 00:00:00 2001 From: "Gary E. Miller" Date: Thu, 27 Dec 2018 15:00:46 -0800 Subject: SConstruct: Add -Wimplicit-fallthrough, if possible. This tells the cc to check implicit fallthrought between cases. The magic comment: /* FALLTHROUGH */ suppressed the warning. Supported by osX, unlike __attribute__ ((fallthough)) which is a gnu-ism. --- SConstruct | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'SConstruct') diff --git a/SConstruct b/SConstruct index 953ddbff..38c1b689 100644 --- a/SConstruct +++ b/SConstruct @@ -986,11 +986,22 @@ else: # because we can't seem to keep scons from passing these to g++. # # Do this after the other config checks, to keep warnings out of them. - for option in ('-Wextra', '-Wall', '-Wno-uninitialized', + for option in ('-Wall', + '-Wcast-align', + '-Wextra', + # -Wimplicit-fallthrough same as + # -Wimplicit-fallthrough=3, except osX hates the + # second flavor + '-Wimplicit-fallthrough', + '-Wmissing-declarations', + '-Wmissing-prototypes', '-Wno-missing-field-initializers', - '-Wcast-align', '-Wmissing-declarations', - '-Wmissing-prototypes', "-Wvla", - '-Wstrict-prototypes', '-Wpointer-arith', '-Wreturn-type'): + '-Wno-uninitialized', + '-Wpointer-arith', + '-Wreturn-type', + '-Wstrict-prototypes', + '-Wvla', + ): if option not in config.env['CFLAGS']: config.CheckCompilerOption(option) -- cgit v1.2.1