summaryrefslogtreecommitdiffstats
path: root/Templates
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-07-14 11:56:26 (GMT)
committerBrad King <brad.king@kitware.com>2017-07-14 12:01:26 (GMT)
commit221ffabfad9ed61c6c1aed8b53e5402a943477bd (patch)
treedf5fcc1a8ba15483ab6d9cf1c69c581ff723f23e /Templates
parent25b72e9097260d1faf254155a1199886c808a58f (diff)
downloadCMake-221ffabfad9ed61c6c1aed8b53e5402a943477bd.zip
CMake-221ffabfad9ed61c6c1aed8b53e5402a943477bd.tar.gz
CMake-221ffabfad9ed61c6c1aed8b53e5402a943477bd.tar.bz2
TestDriver: Fix -Wconversion warning
Since commit v3.8.0-rc1~51^2~1 (TestDriver: calc NumTests at compile time, 2017-01-24) we convert an expression that uses `sizeof()` to an `int` as a compile-time constant. Some GCC versions warn about this with `-Wconversion`. Add a cast to avoid the warning.
Diffstat (limited to 'Templates')
-rw-r--r--Templates/TestDriver.cxx.in4
1 files changed, 2 insertions, 2 deletions
diff --git a/Templates/TestDriver.cxx.in b/Templates/TestDriver.cxx.in
index 0d3f44f..bf61be4 100644
--- a/Templates/TestDriver.cxx.in
+++ b/Templates/TestDriver.cxx.in
@@ -32,8 +32,8 @@ static functionMapEntry cmakeGeneratedFunctionMapEntries[] = {
{ NULL, NULL } /* NOLINT */
};
-static const int NumTests =
- (sizeof(cmakeGeneratedFunctionMapEntries) / sizeof(functionMapEntry)) - 1;
+static const int NumTests = CM_CAST(int,
+ sizeof(cmakeGeneratedFunctionMapEntries) / sizeof(functionMapEntry)) - 1;
/* Allocate and create a lowercased copy of string
(note that it has to be free'd manually) */