[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 6f740381 3/6: Explain why '-Wfloat-conversion
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 6f740381 3/6: Explain why '-Wfloat-conversion' is disabled for clang |
Date: |
Sat, 9 Jul 2022 18:28:39 -0400 (EDT) |
branch: master
commit 6f740381adc1266e58fe94286fe840bda3609e41
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Explain why '-Wfloat-conversion' is disabled for clang
* compiler_clang_warnings.make: Disabled this warning.
* tn_range.tpp: Fixed the only instance of this warning that wasn't a
complaint about converting double to bool.
---
compiler_clang_warnings.make | 2 +-
tn_range.tpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/compiler_clang_warnings.make b/compiler_clang_warnings.make
index 23a10438..4e84270f 100644
--- a/compiler_clang_warnings.make
+++ b/compiler_clang_warnings.make
@@ -62,7 +62,7 @@ clang_c_warnings := \
### -Wdouble-promotion
### -Wexit-time-destructors
### -Wextra-semi-stmt
-### -Wfloat-conversion
+# -Wfloat-conversion: false positives for double-to-bool conversion
# -Wfloat-equal: too many false positives, e.g., 0.0 == X
### -Wglobal-constructors
# -Wlogical-op-parentheses: && is multiplicative; || is additive
diff --git a/tn_range.tpp b/tn_range.tpp
index 84a42687..a16aab1b 100644
--- a/tn_range.tpp
+++ b/tn_range.tpp
@@ -190,7 +190,7 @@ namespace
{
constexpr T z0 = bin_exp
(static_cast<T>(std::numeric_limits<T>::radix)
- ,static_cast<T>(std::numeric_limits<T>::digits)
+ , std::numeric_limits<T>::digits
);
constexpr auto z1lo = std::numeric_limits<long long int>::lowest();
constexpr auto z1hi = std::numeric_limits<long long int>::max();
- [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, 2022/07/09
- [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 <=
- [lmi-commits] [lmi] master f7f9c1e7 4/6: Enable '-Wfloat-conversion' for clang: C only, Greg Chicares, 2022/07/09