[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 982e10c 2/3: Attempt to improve a unit test
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 982e10c 2/3: Attempt to improve a unit test |
Date: |
Thu, 28 Oct 2021 12:15:47 -0400 (EDT) |
branch: master
commit 982e10c93b023e2cf92284f953aa495f27c3caea
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Attempt to improve a unit test
See:
https://lists.nongnu.org/archive/html/lmi/2021-10/msg00049.html
| clang-12 gives only one of the expected warnings
This modification attempts to trigger the other expected warning.
---
miscellany_test.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/miscellany_test.cpp b/miscellany_test.cpp
index 1f63ac6..94f7c5f 100644
--- a/miscellany_test.cpp
+++ b/miscellany_test.cpp
@@ -491,10 +491,10 @@ void test_stifle_unused_warning()
#endif // defined some_undefined_condition
stifle_unused_warning(c);
- // Variable initialized and later used...
- int volatile d {4};
+ // Variable uninitialized at first...
+ int volatile d;
// stifle_unused_warning(d); // [see below]
- // ...but last value assigned...
+ // ...though set later, but last value assigned...
for(int i = 0; i < 7; ++i)
{
d = static_cast<int>(std::clock());