lmi-commits
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]