[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 98265f31 5/6: Don't use clang's '-Wcovered-sw
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 98265f31 5/6: Don't use clang's '-Wcovered-switch-default' |
Date: |
Fri, 8 Jul 2022 16:59:16 -0400 (EDT) |
branch: master
commit 98265f31729db9471d97c32133aa227294b60c40
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Don't use clang's '-Wcovered-switch-default'
This warning flagged numerous instances of
penultimate_enum: // fall through
final_enum: // fall through
default: throw("some exception);
where it is better to leave the "default:" case in place, because it's
defined by the standard language and shows the reader that it hasn't
been overlooked.
---
compiler_clang_warnings.make | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/compiler_clang_warnings.make b/compiler_clang_warnings.make
index c3b04d59..3491b791 100644
--- a/compiler_clang_warnings.make
+++ b/compiler_clang_warnings.make
@@ -53,7 +53,7 @@ clang_c_warnings := \
### [triple '#' marks warnings requiring investigation]
### -Wcomma
### -Wconditional-uninitialized
-### -Wcovered-switch-default
+# -Wcovered-switch-default: better to leave "default:" in place
# -Wdate-time: only for "bit-wise-identical reproducible compilations"
### -Wdeprecated-copy-with-dtor
### -Wdisabled-macro-expansion
- [lmi-commits] [lmi] master updated (f8fac8dd -> 68095897), Greg Chicares, 2022/07/08
- [lmi-commits] [lmi] master 259a59c7 3/6: Enable '-Wshadow' for clang, Greg Chicares, 2022/07/08
- [lmi-commits] [lmi] master 782f0641 4/6: Don't limit the number of clang diagnostics, Greg Chicares, 2022/07/08
- [lmi-commits] [lmi] master 68095897 6/6: Use [[fallthrough]], Greg Chicares, 2022/07/08
- [lmi-commits] [lmi] master 54ce0f17 1/6: Mark clang warnings requiring investigation, Greg Chicares, 2022/07/08
- [lmi-commits] [lmi] master 5c883d42 2/6: '-Wcast-function-type': treat clang the same as gcc, Greg Chicares, 2022/07/08
- [lmi-commits] [lmi] master 98265f31 5/6: Don't use clang's '-Wcovered-switch-default',
Greg Chicares <=