[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 29fec503 13/24: Work around spurious clang "u
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 29fec503 13/24: Work around spurious clang "unused" warnings |
Date: |
Fri, 8 Jul 2022 07:11:26 -0400 (EDT) |
branch: master
commit 29fec50356ae8c2a9ac1693b69dfa62cfe18e49e
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Work around spurious clang "unused" warnings
Worked around a couple of spurious instances because these warnings
could be valuable.
---
compiler_clang_warnings.make | 2 --
tn_range.tpp | 10 ++++++++++
wx_new_test.cpp | 3 +++
3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/compiler_clang_warnings.make b/compiler_clang_warnings.make
index 91c8c049..934d8cac 100644
--- a/compiler_clang_warnings.make
+++ b/compiler_clang_warnings.make
@@ -90,8 +90,6 @@ clang_cxx_warnings := \
-Wno-unknown-pragmas \
-Wno-unneeded-member-function \
-Wno-unreachable-code-break \
- -Wno-unused-macros \
- -Wno-unused-template \
-Wno-weak-template-vtables \
-Wno-weak-vtables \
diff --git a/tn_range.tpp b/tn_range.tpp
index 578a7d79..84a42687 100644
--- a/tn_range.tpp
+++ b/tn_range.tpp
@@ -214,6 +214,12 @@ namespace
}
};
+// clang considers these two templates "unused" in the unit test only
+#if defined LMI_CLANG
+# pragma clang diagnostic push
+# pragma clang diagnostic ignored "-Wunused-template"
+#endif // defined LMI_CLANG
+
template<typename T>
bool is_exact_integer(T t)
{
@@ -256,6 +262,10 @@ namespace
}
}
+#if defined LMI_CLANG
+# pragma clang diagnostic pop
+#endif // defined LMI_CLANG
+
template<typename T, int>
struct bound_adjuster
{};
diff --git a/wx_new_test.cpp b/wx_new_test.cpp
index 3ea4662e..1a4aab24 100644
--- a/wx_new_test.cpp
+++ b/wx_new_test.cpp
@@ -31,6 +31,9 @@
// resulting in an object that wouldn't necessarily work here because
// of unwanted shared-library attributes.
#include "wx_new.cpp"
+#if defined UNIT_TESTING_WX_NEW
+// This meaningless test avoids a clang '-Wunused-macros' warning.
+#endif // defined UNIT_TESTING_WX_NEW
#include "test_tools.hpp"
- [lmi-commits] [lmi] master 06f81a9c 05/24: Refine warning pragmata, (continued)
- [lmi-commits] [lmi] master 06f81a9c 05/24: Refine warning pragmata, Greg Chicares, 2022/07/08
- [lmi-commits] [lmi] master 32145870 03/24: Correct an inconsistency in a comment, Greg Chicares, 2022/07/08
- [lmi-commits] [lmi] master 5334fa49 04/24: Prefer 'nullptr' to '0', Greg Chicares, 2022/07/08
- [lmi-commits] [lmi] master e7ef946d 11/24: Disable a warning only for cgicc, Greg Chicares, 2022/07/08
- [lmi-commits] [lmi] master e97c7ec6 17/24: Enable another clang warning, with one pragmatic exception, Greg Chicares, 2022/07/08
- [lmi-commits] [lmi] master b5cee829 18/24: Explain why '-Wpadded' is disabled for clang, Greg Chicares, 2022/07/08
- [lmi-commits] [lmi] master 9a551769 22/24: Disable floating-point comparison warning, Greg Chicares, 2022/07/08
- [lmi-commits] [lmi] master bb0434c3 09/24: Avoid clang warning on silliness, Greg Chicares, 2022/07/08
- [lmi-commits] [lmi] master 17c9b8e0 16/24: Enable another clang warning, except for cgicc, Greg Chicares, 2022/07/08
- [lmi-commits] [lmi] master 1be7d13d 23/24: Don't let clang warn about lawful comments, Greg Chicares, 2022/07/08
- [lmi-commits] [lmi] master 29fec503 13/24: Work around spurious clang "unused" warnings,
Greg Chicares <=
- [lmi-commits] [lmi] master 89930e76 15/24: Experimentally work around a clang warning, Greg Chicares, 2022/07/08
- [lmi-commits] [lmi] master 06024f1f 19/24: '-Wold-style-cast': treat clang the same as gcc, Greg Chicares, 2022/07/08
- [lmi-commits] [lmi] master 6a5c4bb3 21/24: Distinguish gcc vs. clang floating-point warnings, Greg Chicares, 2022/07/08