mirror of https://git.tukaani.org/xz.git
Build: Use -Wimplicit-fallthrough=5 when supported
Now that we have the FALLTHROUGH macro, use the strictest mode with GCC so that comment-based fallthrough markings are no longer accepted. In GCC, -Wextra includes -Wimplicit-fallthrough=3 and -Wimplicit-fallthrough is the same as -Wimplicit-fallthrough=3. Thus, the strict mode requires specifying -Wimplicit-fallthrough=5. Clang has -Wimplicit-fallthrough which is *not* enabled by -Wextra. Clang doesn't have a variant that takes an argument. Thus we need to check for -Wimplicit-fallthrough. Do it before checking for -Wimplicit-fallthrough=5 so that the latter overrides the former when using GCC.
This commit is contained in:
parent
94adc996e4
commit
1a8a1ad9a1
|
@ -434,6 +434,8 @@ if(CMAKE_C_COMPILER_ID MATCHES GNU|Clang)
|
|||
-Wmissing-prototypes
|
||||
-Wmissing-declarations
|
||||
-Wredundant-decls
|
||||
-Wimplicit-fallthrough
|
||||
-Wimplicit-fallthrough=5
|
||||
|
||||
-Wc99-compat
|
||||
-Wc11-extensions
|
||||
|
|
|
@ -1299,6 +1299,8 @@ AS_IF([test "$GCC" = yes], [
|
|||
-Wmissing-prototypes \
|
||||
-Wmissing-declarations \
|
||||
-Wredundant-decls \
|
||||
-Wimplicit-fallthrough \
|
||||
-Wimplicit-fallthrough=5 \
|
||||
\
|
||||
-Wc99-compat \
|
||||
-Wc11-extensions \
|
||||
|
|
Loading…
Reference in New Issue