[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 9b175313 2/6: Enable '-Wconditional-uninitial
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 9b175313 2/6: Enable '-Wconditional-uninitialized' for clang |
Date: |
Sat, 9 Jul 2022 18:28:39 -0400 (EDT) |
branch: master
commit 9b175313cf5df87b4907e95078a16dadb38eeb89
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Enable '-Wconditional-uninitialized' for clang
* compiler_clang_warnings.make: Enable this warning.
* zero.hpp: Ignore this warning in one place only. Use a pragma for
this purpose, because this code is used only to only to demonstrate
that TOMS 748 is suboptimal, and there is no point in alleviating
whatever defects it possesses.
---
compiler_clang_warnings.make | 2 --
zero.hpp | 8 ++++++++
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/compiler_clang_warnings.make b/compiler_clang_warnings.make
index 2933be24..23a10438 100644
--- a/compiler_clang_warnings.make
+++ b/compiler_clang_warnings.make
@@ -52,7 +52,6 @@ clang_c_warnings := \
# -W++98-compat-pedantic: backward compatibility not desirable
### [triple '#' marks warnings requiring investigation]
### -Wcomma
-### -Wconditional-uninitialized
# -Wcovered-switch-default: better to leave "default:" in place
# -Wdate-time: only for "bit-wise-identical reproducible compilations"
### -Wdeprecated-copy-with-dtor
@@ -84,7 +83,6 @@ clang_cxx_warnings := \
-Wno-c++20-compat \
-Wno-c++98-compat-pedantic \
-Wno-comma \
- -Wno-conditional-uninitialized \
-Wno-covered-switch-default \
-Wno-date-time \
-Wno-deprecated-copy-with-dtor \
diff --git a/zero.hpp b/zero.hpp
index 894719e5..695a1f94 100644
--- a/zero.hpp
+++ b/zero.hpp
@@ -1310,8 +1310,16 @@ int rroot_(FunctionalType& f, int* nprob, int* neps,
double* eps,
/* FOUR FUNCTION VALUES "FA", "FB", "FD", AND "FE" ARE DISTINCT, AND */
/* HENCE "PZERO" WILL BE CALLED. */
+#if defined LMI_CLANG
+# pragma clang diagnostic push
+# pragma clang diagnostic ignored "-Wconditional-uninitialized"
+#endif // defined LMI_CLANG
+ // clang: "variable 'fd' may be uninitialized when used here"
prof = (fa - fb) * (fa - fd) * (fa - fe) * (fb - fd) * (fb - fe) * (fd -
fe);
+#if defined LMI_CLANG
+# pragma clang diagnostic pop
+#endif // defined LMI_CLANG
if (itnum == 2 || prof == 0.) {
newqua_(a, b, &d_0, &fa, &fb, &fd, &c0, &c2);
} else {
- [lmi-commits] [lmi] master updated (68095897 -> 931cce6f), Greg Chicares, 2022/07/09
- [lmi-commits] [lmi] master 8b387bdc 1/6: Add "[[noreturn]]" in a few places, Greg Chicares, 2022/07/09
- [lmi-commits] [lmi] master 9b175313 2/6: Enable '-Wconditional-uninitialized' for clang,
Greg Chicares <=
- [lmi-commits] [lmi] master 931cce6f 6/6: Explain why several clang warnings are disabled, Greg Chicares, 2022/07/09
- [lmi-commits] [lmi] master d8bb7cb4 5/6: Repeat less, Greg Chicares, 2022/07/09
- [lmi-commits] [lmi] master 6f740381 3/6: Explain why '-Wfloat-conversion' is disabled for clang, Greg Chicares, 2022/07/09
- [lmi-commits] [lmi] master f7f9c1e7 4/6: Enable '-Wfloat-conversion' for clang: C only, Greg Chicares, 2022/07/09