diff options
author | Sean McBride <sean@rogue-research.com> | 2019-01-11 21:58:56 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-01-15 19:09:46 (GMT) |
commit | b056bc34258267c4ae59c72e3777d0a0f0b5a1b1 (patch) | |
tree | aa1632cdb773244aa402c0cf7ccd4f6e53a28536 /Tests | |
parent | da566d4de885130e182edc80f13691f5ca24bb61 (diff) | |
download | CMake-b056bc34258267c4ae59c72e3777d0a0f0b5a1b1.zip CMake-b056bc34258267c4ae59c72e3777d0a0f0b5a1b1.tar.gz CMake-b056bc34258267c4ae59c72e3777d0a0f0b5a1b1.tar.bz2 |
Fix most clang -Wextra-semi-stmt warnings in C++ files
Suppress one in code generated by flex.
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeLib/testString.cxx | 12 | ||||
-rw-r--r-- | Tests/CMakeLib/testSystemTools.cxx | 12 |
2 files changed, 13 insertions, 11 deletions
diff --git a/Tests/CMakeLib/testString.cxx b/Tests/CMakeLib/testString.cxx index 2aa1459..af5e41e 100644 --- a/Tests/CMakeLib/testString.cxx +++ b/Tests/CMakeLib/testString.cxx @@ -16,10 +16,12 @@ #include <utility> #define ASSERT_TRUE(x) \ - if (!(x)) { \ - std::cout << "ASSERT_TRUE(" #x ") failed on line " << __LINE__ << "\n"; \ - return false; \ - } + do { \ + if (!(x)) { \ + std::cout << "ASSERT_TRUE(" #x ") failed on line " << __LINE__ << "\n"; \ + return false; \ + } \ + } while (false) static bool testConstructDefault() { @@ -144,7 +146,6 @@ static bool testConstructFromCStr() { std::cout << "testConstructFromCStr()\n"; return testFromCStr(cstr); - ; } static bool testAssignFromCStr() @@ -153,7 +154,6 @@ static bool testAssignFromCStr() cm::String str; str = cstr; return testFromCStr(str); - ; } static const std::string stdstr = "abc"; diff --git a/Tests/CMakeLib/testSystemTools.cxx b/Tests/CMakeLib/testSystemTools.cxx index 623ad28..96a4819 100644 --- a/Tests/CMakeLib/testSystemTools.cxx +++ b/Tests/CMakeLib/testSystemTools.cxx @@ -16,11 +16,13 @@ failed = 1 #define cmAssert(exp, m) \ - if ((exp)) { \ - cmPassed(m); \ - } else { \ - cmFailed(m); \ - } + do { \ + if ((exp)) { \ + cmPassed(m); \ + } else { \ + cmFailed(m); \ + } \ + } while (false) int testSystemTools(int /*unused*/, char* /*unused*/ []) { |