[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 8f25a9bd 5/8: Resolve an issue identified by
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 8f25a9bd 5/8: Resolve an issue identified by UBSAN |
Date: |
Mon, 6 Jun 2022 18:40:33 -0400 (EDT) |
branch: master
commit 8f25a9bd977df3db393eb2ab16ce1ef6d6e18a84
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Resolve an issue identified by UBSAN
Suppressed one instance of undefined behavior, which UBSAN flagged.
Marked another one that UBSAN doesn't complain about.
---
input_test.cpp | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/input_test.cpp b/input_test.cpp
index ba679ccb..9966169b 100644
--- a/input_test.cpp
+++ b/input_test.cpp
@@ -160,9 +160,19 @@ void input_test::test_product_database()
# pragma clang diagnostic ignored
"-Wtautological-constant-out-of-range-compare"
#endif // defined LMI_CLANG
- // This value corresponds to no enumerator, but C++ allows that.
+#if 0
+ // This value corresponds to no enumerator. Formerly, the
+ // resulting value was unspecified:
+ // https://cplusplus.github.io/CWG/issues/1094.html
+ // but now this is undefined behavior:
+ // https://cplusplus.github.io/CWG/issues/1766.html
+ // and therefore the test is suppressed, but retained as
+ // a cautionary example, and as a convenient test in case
+ // gcc adds a warning like clang's (pragma above).
db.query_into(DB_ChildRiderMinAmt, a);
LMI_TEST_EQUAL(25000, a);
+#endif // 0
+ // UBSAN doesn't complain about this; shouldn't it?
auto const b {db.query<oenum_alb_or_anb>(DB_ChildRiderMinAmt)};
LMI_TEST_EQUAL(25000, b);
- [lmi-commits] [lmi] master updated (a0472892 -> 9be3fe4e), Greg Chicares, 2022/06/06
- [lmi-commits] [lmi] master 43c26210 2/8: Make a unit test more thorough, Greg Chicares, 2022/06/06
- [lmi-commits] [lmi] master 9be3fe4e 8/8: Update dotfiles, Greg Chicares, 2022/06/06
- [lmi-commits] [lmi] master 4d1b7487 3/8: Improve a local name, Greg Chicares, 2022/06/06
- [lmi-commits] [lmi] master d7249cec 1/8: Test whether macros were already defined, Greg Chicares, 2022/06/06
- [lmi-commits] [lmi] master 8f25a9bd 5/8: Resolve an issue identified by UBSAN,
Greg Chicares <=
- [lmi-commits] [lmi] master fe203b1e 4/8: Use undefined-behavior sanitizer, Greg Chicares, 2022/06/06
- [lmi-commits] [lmi] master cc85be94 6/8: Resolve another issue identified by UBSAN, Greg Chicares, 2022/06/06
- [lmi-commits] [lmi] master 7ae73fae 7/8: Localize an 'f2c' global, Greg Chicares, 2022/06/06