From 17f0468c1656aa91d7cc5e3174a797312a9364c3 Mon Sep 17 00:00:00 2001 From: Andres Noetzli Date: Mon, 18 Nov 2019 12:28:54 -0800 Subject: Use -Wimplicit-fallthrough (#3464) This commit enables compiler warnings for implicit fallthroughs in switch statements that are not explicitly marked as such. The commit introduces a new macro `CVC4_FALLTHROUGH` that can be used to indicate that a fallthrough is intentional. The commit fixes existing warnings and a bug in the arithmetic rewriter for `abs` (the bug likely couldn't be triggered easily because we rewrite `abs` to an `ite` while expanding definitions). To have the new macro also available in the parser, the commit changes `src/base/check.h` to be visible to the parser (it includes `cvc4_private_library.h` now instead of `cvc4_private.h`). --- src/preprocessing/passes/unconstrained_simplifier.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/preprocessing/passes') diff --git a/src/preprocessing/passes/unconstrained_simplifier.cpp b/src/preprocessing/passes/unconstrained_simplifier.cpp index c41f1fca9..1695ae2ff 100644 --- a/src/preprocessing/passes/unconstrained_simplifier.cpp +++ b/src/preprocessing/passes/unconstrained_simplifier.cpp @@ -251,6 +251,7 @@ void UnconstrainedSimplifier::processUnconstrained() checkParent = true; break; } + CVC4_FALLTHROUGH; case kind::BITVECTOR_COMP: case kind::LT: case kind::LEQ: @@ -424,6 +425,7 @@ void UnconstrainedSimplifier::processUnconstrained() { break; } + CVC4_FALLTHROUGH; case kind::XOR: case kind::BITVECTOR_XOR: case kind::BITVECTOR_XNOR: -- cgit v1.2.3